/** * {@inheritDoc} */ protected function toEntity(array $category) { $entity = new VirtualEntity(); $entity->setId($category['id'])->setLangId($category['lang_id'])->setCount($this->postManager->countAllPublishedByCategoryId($entity->getId()))->setSlug($this->webPageManager->fetchSlugByWebPageId($category['web_page_id']))->setTitle($category['name'] . sprintf(' (%s) ', $entity->getCount()))->setUrl($this->webPageManager->surround($entity->getSlug(), $entity->getLangId())); return $entity; }