public function all()
 {
     $model = ReflectionUtils::createNewInstance(static::$forModel);
     $query = Query::getInstance()->select()->from($model->table())->order(Order::desc("id"));
     $resultSet = $this->getDatabase()->query($query)->listResult();
     return new ResultSet($resultSet);
 }
Exemplo n.º 2
0
 public static function load($classname, array $arguments = null)
 {
     $filename = self::getFilePath($classname);
     include_once $filename;
     $classes = get_declared_classes();
     foreach ($classes as $class) {
         $index = strpos($class, $classname);
         if ($index !== false) {
             return ReflectionUtils::createNewInstance($class, $arguments);
         }
     }
     return null;
 }