loadEntryCountField($entity); } public function loadAdditionalFieldsForList(Entity $entity) { parent::loadAdditionalFields($entity); $this->loadEntryCountField($entity); } protected function loadEntryCountField(Entity $entity) { $count = 0; $count += $this->getEntityManager()->getRepository('TargetList')->countRelated($entity, 'contacts'); $count += $this->getEntityManager()->getRepository('TargetList')->countRelated($entity, 'leads'); $count += $this->getEntityManager()->getRepository('TargetList')->countRelated($entity, 'users'); $count += $this->getEntityManager()->getRepository('TargetList')->countRelated($entity, 'accounts'); $entity->set('entryCount', $count); } }