Exemple #1
0
 /** Gets TLabel object by property $property_name with value $property_value.
  * @return TLabel or NULL in case of error
  */
 public static function getLabel($property_name, $property_value)
 {
     global $LINK_DB;
     $query = "SELECT * FROM label 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;
     }
     $label_arr = array();
     while ($row = $result->fetch_object()) {
         $label_arr[] = new TLabel($row->id, $row->short_name, $row->name, TLabelCategory::getByID($row->category_id));
     }
     return $label_arr;
 }
 /** Gets TLabelCategory object by parent_id
  * @return TLabelCategory or NULL in case of error
  */
 public static function getByParent($parent_id, $parent_obj = NULL)
 {
     return TLabelCategory::getLabelCategory("parent_id", $parent_id, $parent_obj);
 }