/** * Retrieves a single TenantObjectMethod with the given ID. * @param int $id The ID of the TenantObjectMethod to return * @return NULL|\PhoenixSNS\Objects\TenantObjectMethod The TenantObjectMethod with the given ID */ public static function GetByID($id) { if (!is_numeric($id)) { return null; } global $MySQL; $query = "SELECT * FROM " . System::$Configuration["Database.TablePrefix"] . "TenantObjectMethods WHERE method_ID = " . $id; $result = $MySQL->query($query); if ($result === false) { return null; } $count = $result->num_rows; if ($count == 0) { return null; } $values = $result->fetch_assoc(); return TenantObjectMethod::GetByAssoc($values); }
public function GetMethods($max = null) { global $MySQL; $query = "SELECT * FROM " . System::$Configuration["Database.TablePrefix"] . "TenantObjectMethods WHERE method_ObjectID = " . $this->ID; if (is_numeric($max)) { $query .= " LIMIT " . $max; } $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[] = TenantObjectMethod::GetByAssoc($values); } return $retval; }