Exemple #1
0
 /**
  * Get all statuses
  * 
  * @return object $statuses
  */
 public static function getAll()
 {
     $out = array();
     $records = Doctrine_Query::create()->from('Statuses s')->execute(array(), Doctrine_Core::HYDRATE_ARRAY);
     // normalize data
     foreach ($records as $record) {
         $section = strtolower($record['section']);
         $code = strtolower($record['code']);
         // code as key
         $out[$section][$code] = $record;
         // status_id as key
         $out['id:' . $record['status_id']] = $record;
         // PHP BUG: See Statuses::getById
     }
     return Shineisp_Commons_Utilities::array2object($out);
 }