Example #1
0
 /**
  * Load a model with it's primary key only
  * @param string $model
  * @param string $primary
  * @return \Virge\ORM\Component\Collection\Collection
  */
 public static function lazy($model, $primary = 'id')
 {
     $collection = new Collection();
     $collection->setModel(new $model());
     $collection->setLazy(true);
     $collection->setPrimary($primary);
     $collection->setLimit(NULL);
     $table = $collection->getModel()->getSqlTable();
     $collection->setTable($table);
     return $collection;
 }