/** * Do an efficient count on the collection * * @return integer */ public function count() { if ($this->isInitialized()) { return $this->collection->count(); } // Return cached result in case count query was already executed if ($this->count !== null) { return $this->count; } return $this->count = $this->entityPersister->count($this->criteria); }
public function testCountEntities() { $this->assertEquals(0, $this->_persister->count()); }