private function GetEntries() { require_once "Records/card.php"; require_once "Records/entry.php"; $s = Card::GetAllCardsQuery() ->join(array("e" => Entry::$TABLE), "e.card = ca.id", array()) ->where("e.cube = ?", $this->id); $r = DB::zdb()->fetchAll($s); $this->cards = array(); foreach ( $r as $rr ) $this->cards[] = new Card($rr); }
public function __construct($card) { if ( !is_array($card) ) { $s = Card::GetAllCardsQuery() ->where("ca.id = ?", $card); $card = DB::zdb()->fetchRow($s); } $this->data = $card; $this->id = $card["id"]; $this->name = $card["name"]; $this->cardFrame = $card["frame_url"]; $this->text = $card["text"]; unset($this->data["id"]); }