protected function loadOnce() { $this->loadedCollection = $this->load(); foreach ($this->addedItems as $entity) { $this->loadedCollection->add($entity); } }
public function testAddingEntitiesToCollection() { $c = new Collection(); $e = new Entity(); $f = new Entity(); $c->add($e)->add($f); $this->assertEquals(array($e, $f), $c->all()); }
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)); }