| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <?php
- /**
- * Custom filter entity file.
- *
- * Creates the entity and makes it available.
- *
- * @category Entity
- */
- /**
- * Require dependent entities if not present.
- */
- require_once(PATH::ENTITY . "Entity.php");
- /**
- * A custom_Filter.
- *
- * Represents an object from the table 'filter'.
- *
- * @category Entity
- */
- class Custom_Filter extends Entity{
- /**
- * @var int Player identifier.
- */
- public $uid;
- /**
- * @var int Filter identifier.
- */
- public $id;
- /**
- * @var string Name of the pge the filter is for.
- */
- public $page;
- /**
- * @var string Filter name.
- */
- public $name;
- /**
- * @var string Filter description.
- */
- public $description;
- /**
- * @var string Filter condition (sql where clause).
- */
- public $condition;
- /**
- * Constructor.
- *
- * Searches the database and retrieves the information about the
- * run, populating it and it's items.
- *
- * @param resource $db Connection to the database.
- * @param int $id Filter identifier.
- */
- public function __construct($db, $id){
- parent::__construct($db);
- $s = "
- SELECT
- uid,
- id,
- page,
- name,
- description,
- condition
- FROM filter
- WHERE id = $id;
- ";
- $q = $this->db->query($s);
- $r = $q->fetchArray(SQLITE3_ASSOC);
- $this->id = $r["id"];
- $this->uid = $r["uid"];
- $this->page = $r["page"];
- $this->name = HTML::e($r["name"]);
- $this->description = $r["description"]; // Must be properly formated!
- $this->condition = $r["condition"];
- }
- }
- ?>
|