public function getIteratorCount(IEntity $parent, ICollection $collection) { $counts = $this->executeCounts($collection, $parent); $id = $parent->getValue('id'); return isset($counts[$id]) ? $counts[$id] : 0; }