/** Gets TTranslation object by property $property_name with value $property_value. * @return TTranslation or NULL in case of error */ public static function getTranslation($property_name, $property_value, $meaning_obj = NULL) { global $LINK_DB; $query = "SELECT * FROM translation 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; } $translation_arr = array(); while ($row = $result->fetch_object()) { /* if ($meaning_obj == NULL) $meaning_obj = TMeaning::getByID($row->meaning_id); if ($meaning_obj != NULL) $lang_pos_obj = $meaning_obj->getLangPOS(); else $lang_pos_obj = NULL; */ $translation = new TTranslation($row->id, NULL, $row->meaning_summary, $meaning_obj); $translation->entry = TTranslationEntry::getByTranslation($row->id, $translation); $translation_arr[] = $translation; } return $translation_arr; }