/**
  * Retrieves a single TenantObjectInstanceProperty with the given ID.
  * @param int $id The ID of the TenantObjectInstanceProperty to return
  * @return NULL|\PhoenixSNS\Objects\TenantObjectInstanceProperty The TenantObjectInstanceProperty with the given ID, or NULL if no TenantObjectInstanceProperty with the given ID was found
  */
 public static function GetByID($id)
 {
     if (!is_numeric($id)) {
         return null;
     }
     global $MySQL;
     $query = "SELECT * FROM " . System::$Configuration["Database.TablePrefix"] . "TenantObjectInstanceProperties WHERE property_ID = " . $id;
     $result = $MySQL->query($query);
     $count = $result->num_rows;
     if ($count == 0) {
         return null;
     }
     $values = $result->fetch_assoc();
     return TenantObjectInstanceProperty::GetByAssoc($values);
 }
예제 #2
0
 public function GetInstanceProperties($max = null)
 {
     global $MySQL;
     $query = "SELECT * FROM " . System::$Configuration["Database.TablePrefix"] . "TenantObjectInstanceProperties WHERE property_ObjectID = " . $this->ID;
     $result = $MySQL->query($query);
     $retval = array();
     if ($result === false) {
         return $retval;
     }
     $count = $result->num_rows;
     for ($i = 0; $i < $count; $i++) {
         $values = $result->fetch_assoc();
         $retval[] = TenantObjectInstanceProperty::GetByAssoc($values);
     }
     return $retval;
 }