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