Пример #1
0
 protected function loadOnce()
 {
     $this->loadedCollection = $this->load();
     foreach ($this->addedItems as $entity) {
         $this->loadedCollection->add($entity);
     }
 }
Пример #2
0
 public function testAddingEntitiesToCollection()
 {
     $c = new Collection();
     $e = new Entity();
     $f = new Entity();
     $c->add($e)->add($f);
     $this->assertEquals(array($e, $f), $c->all());
 }
Пример #3
0
 public function testSimplePaginate()
 {
     $mapper = get_mapper('AnalogueTest\\App\\Permission');
     $c = new EntityCollection();
     $y = 0;
     for ($x = 0; $x < 30; $x++) {
         $c->add(new Permission("P{$x}"));
     }
     $mapper->store($c);
     $paginator = $mapper->query()->simplePaginate(5);
     $this->assertEquals(5, count($paginator));
 }