function it_does_transform_collection_with_objects_value($entityOne, $entityTwo, TaxonInterface $entityThree, TaxonInterface $entityFour, Collection $collection)
 {
     $entityThree->getId()->willReturn(3);
     $entityFour->getId()->willReturn(4);
     $entityOne->getTaxons()->willReturn(array($entityThree));
     $entityTwo->getTaxons()->willReturn(array($entityFour));
     $entityThree->getChildren()->willReturn(array());
     $entityFour->getChildren()->willReturn(array());
     $collection->contains($entityThree)->willReturn(true);
     $collection->contains($entityFour)->willReturn(true);
     $this->transform($collection)->shouldReturn(array(1 => array($entityThree), 2 => array($entityFour)));
 }
예제 #2
0
 protected function createTaxonomiesMenuNode(ItemInterface $menu, TaxonInterface $taxon)
 {
     foreach ($taxon->getChildren() as $child) {
         $childMenu = $menu->addChild($child->getName(), array('route' => $child, 'labelAttributes' => array('icon' => 'icon-angle-right')));
         if ($child->getPath()) {
             $childMenu->setLabelAttribute('data-image', $child->getPath());
         }
         $this->createTaxonomiesMenuNode($childMenu, $child);
     }
 }
예제 #3
0
 /**
  * {@inheritdoc}
  */
 public function getTaxons($taxonomy = null)
 {
     return $this->root->getChildren();
 }