| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- require_once($path["page"] . "Page.php");
- require_once($path["entity"] . "Monster_Collection.php");
- /**
- * Collection page model.
- */
- class Collection_Page extends Page{
- /**
- * List of all the {@see Monster_base}.
- */
- public $base_monster = [];
- /**
- * Constructor.
- *
- * Retrieves the data and initializes the variables.
- *
- * @param SQLite3 $db Connection to the database.
- */
- public function __construct($db){
- global $path;
- global $root;
- parent::__construct($db);
- $this->view = $path["view"] . "collection.php";
- $s =
- "SELECT id " .
- "FROM monster_base " .
- "ORDER BY name; ";
- $q = $this->db->query($s);
- while ($r = $q->fetchArray(SQLITE3_ASSOC)){
- array_push($this->base_monster, new Monster_Base($this->db, $r["id"]));
- }
- $this->title = "";
- $this->name = "";
- $this->description = "";
- $this->favicon = "";
- $this->icon = "";
- $this->canonical = $root . "collection/";
- $this->author = $root;
- }
- }
- ?>
|