Beispiel #1
0
 /**
  * @return string|TableObject[]
  */
 function subjectCombinations()
 {
     if ($subjCombIds = $this->config()->getLinkedRecs('Subject_combination')) {
         return Subject_combination::findByCondition("id in(" . join(",", $subjCombIds) . ")");
     }
     return "";
 }
Beispiel #2
0
 function subjectCombinations()
 {
     global $db;
     $ltable = Subject_combination::tablename() . "__" . static::tablename();
     $data = Subject_combination::tablename() . "_id";
     $condition = static::tablename() . "_id = " . $this->id;
     $output = array();
     $recs = $db->findBySql("SELECT {$data} FROM {$ltable} WHERE {$condition}");
     if ($recs) {
         foreach ($recs as $key => $rec) {
             $output[] = $rec[$data];
         }
     }
     return $output;
 }