/** Gets TRelation object by property $property_name with value $property_value. * @return TRelation or NULL in case of error */ public static function getRelation($property_name, $property_value, $meaning_obj = NULL) { global $LINK_DB; $query = "SELECT * FROM relation WHERE `{$property_name}`='{$property_value}' order by id"; $result = $LINK_DB->query_e($query, "Query failed in " . __METHOD__ . " in file <b>" . __FILE__ . "</b>, string <b>" . __LINE__ . "</b>"); if ($LINK_DB->query_count($result) == 0) { return NULL; } $relation_arr = array(); while ($row = $result->fetch_object()) { /* if ($meaning_obj == NULL) $meaning_obj = TMeaning::getByID($row->meaning_id); */ $relation_arr[] = new TRelation($row->id, $meaning_obj, TWikiText::getByID($row->wiki_text_id), TRelationType::getByID($row->relation_type_id), $row->meaning_summary); } return $relation_arr; }