public function testItems()
 {
     $item = new DummyItem(new Builder());
     $registy = new ItemsRegistry();
     $registy->addItem($item);
     $this->assertNull($registy->getItemById(10));
 }
Exemple #2
0
 /**
  * @param ItemInterface $item
  * @param int $level
  */
 protected function addToTreeStructure(ItemInterface $item, $level)
 {
     if ($level > 0) {
         $previousItemId = $this->levelLastItem[$level - 1];
         /** @var ItemInterface $previousItem */
         $previousItem = $this->itemsRegistry->getItemById($previousItemId);
         if ($previousItem) {
             $previousItem->addClild($item);
         }
         return;
     }
     $this->getTreeStructure()->addItem($item);
 }