/** * get all flashcards for an object * * @param int obj_id * @return array card_id => card object */ public static function _getAll($a_obj_id) { global $ilDB; $query = "SELECT card_id, obj_id, term_id FROM rep_robj_xflc_cards " . "WHERE obj_id = " . $ilDB->quote($a_obj_id, 'integer'); $result = $ilDB->query($query); $cards = array(); while ($row = $ilDB->fetchAssoc($result)) { $card = new ilFlashcard(); $card->setRowData($row); $cards[$card->card_id] = $card; } return $cards; }
/** * Read the flash cards assigned to this object */ function readCards() { $this->plugin->includeClass('class.ilFlashcard.php'); $this->setCards(ilFlashcard::_getAll($this->getId())); }