예제 #1
0
파일: model.php 프로젝트: pnixx/boot
 /**
  * Чтение записей, возврат массива
  * @return Model_Collection
  */
 public function row_all()
 {
     $r = array();
     $i = 0;
     while ($line = $this->_select->row($i++)) {
         $r[] = $line;
     }
     //Если ничего не найдено
     if (count($r) == 0) {
         return null;
     }
     //Строим класс коллекции
     $class = class_exists(get_class($this) . "_Collection") ? get_class($this) . "_Collection" : "Model_Collection";
     $class_row = class_exists(get_class($this) . "_Row") ? get_class($this) . "_Row" : "Model_Row";
     //Возвращаем данные
     return new $class($this->table, $this->belongs_to, $this->has_many, $this->pkey, $class_row, $this, $r);
 }