コード例 #1
0
 /**
  * get all flashcards for an object
  *
  * @param 	 int 		obj_id
  * @return   array   	card_id => usage object
  */
 public static function _getAll($a_obj_id, $a_user_id)
 {
     global $ilDB;
     $query = "SELECT u.obj_id, u.user_id, u.card_id, " . " u.status, u.last_status, u.last_checked, u.last_result, u.times_checked, u.times_known " . " FROM rep_robj_xflc_usage u" . " INNER JOIN rep_robj_xflc_cards c ON u.card_id = c.card_id" . " WHERE u.obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " AND u.user_id = " . $ilDB->quote($a_user_id, 'integer');
     $result = $ilDB->query($query);
     $usages = array();
     while ($row = $ilDB->fetchAssoc($result)) {
         $usage = new ilFlashcardUsage();
         $usage->setRowData($row);
         $usages[$usage->getCardId()] = $usage;
     }
     return $usages;
 }