/** * @param \obo\Interfaces\IQuerySpecification $specification * @return int */ public function countEntities(\obo\Interfaces\IQuerySpecification $specification = null) { $ownedEntityClassName = $this->entitiesClassName; $ownedEntityManagerName = $ownedEntityClassName::entityInformation()->managerName; return $ownedEntityManagerName::countRecords(\obo\Carriers\QueryCarrier::instance()->addSpecification($this->getSpecification()->addSpecification($specification))); }