Sulu\Bundle\CategoryBundle\Category\CategoryManagerInterface::findByIds PHP Method

findByIds() public method

If an id of the array is not assigned to a category, no error is thrown.
public findByIds ( array $ids ) : Sulu\Bundle\CategoryBundle\Entity\CategoryInterface[]
$ids array
return Sulu\Bundle\CategoryBundle\Entity\CategoryInterface[]
    public function findByIds(array $ids);

Usage Example

Esempio n. 1
0
 /**
  * {@inheritdoc}
  */
 public function read(NodeInterface $node, PropertyInterface $property, $webspaceKey, $languageCode, $segmentKey)
 {
     $data = [];
     $categoryIds = $node->getPropertyValueWithDefault($property->getName(), []);
     $categories = $this->categoryManager->findByIds($categoryIds);
     $categories = $this->categoryManager->getApiObjects($categories, $languageCode);
     foreach ($categories as $category) {
         $data[] = $category->toArray();
     }
     $this->setData($data, $property);
 }
All Usage Examples Of Sulu\Bundle\CategoryBundle\Category\CategoryManagerInterface::findByIds