Creates new admin menu item

@param \SimpleXMLElement $item
348065
protected function addMenuItem(\SimpleXMLElement $item)
    {
        $em            = $this->doctrineHelper->getEntityManager();
        $adminMenuItem = $this->adminMenuRepository->findOneBy(['identifier' => (string)$item->identifier]);
        $parent        = $this->adminMenuRepository->findOneBy(['identifier' => (string)$item->parent]);
        
        if (null === $adminMenuItem) {
            $adminMenuItem = new AdminMenu();
            $adminMenuItem->setCssClass((string)$item->css_class);
            $adminMenuItem->setIdentifier((string)$item->identifier);
            $adminMenuItem->setName((string)$item->name);
            $adminMenuItem->setRouteName((string)$item->route_name);
            $adminMenuItem->setHierarchy((int)$item->hierarchy);
            $adminMenuItem->setParent($parent);
            
            $em->persist($adminMenuItem);
            $em->flush();
        }
    }
1211255
private function menuHelper($item)
    {
        // recurse into submenus
        if (isset($item['submenu']) && is_array($item['submenu'])) {
            $item['submenu'] = $this->menuHelper($item['submenu']);
        }

        if (isset($item['route'])) {
            $item['link'] = $this->resolveRouteToLink($item);
        } elseif (isset($item['path'])) {
            $item = $this->resolvePathToContent($item);
        }

        return $item;
    }
121471
private function appendItem(\sb\RSS\Item $item)
    {

        $new_item = $this->createElement("item");

        foreach(get_object_vars($item) as $key=>$val){
            if($item->{$key} instanceof \sb\RSS\ItemEnclosure){
                $enclosure = $this->createElement('enclosure');
                foreach($item->{$key} as $n=>$v){
                    $enclosure->setAttribute($n, $v);
                }

                $new_item->appendChild($enclosure);
            }

            if($key == 'categories'){
                foreach($item->{$key} as $category){
                    $new_item->appendChild($this->createNode('category', $category));
                }
            }

            if(is_string($val) && !empty($val)){

                $new_item->appendChild($this->createNode($key, $val, $key == 'description'));
            }
        }

        if(empty($item->guid)){
            $new_item->appendChild($this->createNode('guid', $item->link));
        }

        $this->channel->appendChild($new_item);

    }
626046
public function removeItem(\Wucdbm\Bundle\MenuBuilderBundle\Entity\MenuItem $item) {
        $this->items->removeElement($item);
    }
1196562
private function addItem(Item $item)
    {
        $em = $this->getDoctrine()->getManager();
        $em->persist($item);
        $em->flush();

        return $this->redirect($this->generateUrl(
            'item_show',
            ['id' => $item->getId(), 'name' => $item->getUrlName()]
        ));
    }
1363666
public function add(MenuItem $item)
    {
        $this->collection[$this->count] = $item;
        $this->names[$item->getName()]  = $this->count;

        $this->count++;

        return $this;
    }
1199085
public function setItem(Item $item)
    {
        if ($this->item !== $item) {
            $this->item = $item->addGenre($this);
        }

        return $this;
    }
385430
public function doLog( common_log_Item $item)
    {
        
    	$doc = new DOMDocument();
		$doc->preserveWhiteSpace = false;
		$doc->formatOutput = true;
		$success = @$doc->load($this->filename);
		if (!$success) {
            $doc->loadXML('<events></events>');
        }

		$event_element = $doc->createElement("event");

		$message = $doc->createElement("description");
		$message->appendChild(
				$doc->createCDATASection($item->getDescription())
		);
		$event_element->appendChild($message);
		
		$file = $doc->createElement("file");
		$file->appendChild(
				$doc->createCDATASection($item->getCallerFile())
		);
		$event_element->appendChild($file);
		
		$line = $doc->createElement("line");
		$line->appendChild(
				$doc->createCDATASection($item->getCallerLine())
		);
		$event_element->appendChild($line);
		
		$datetime = $doc->createElement("datetime");
		$datetime->appendChild(
				$doc->createCDATASection($item->getDateTime())
		);
		$event_element->appendChild($datetime);
		
		$severity = $doc->createElement("severity");
		$severity->appendChild(
				$doc->createCDATASection($item->getSeverity())
		);
		$event_element->appendChild($severity);

		
		$doc->documentElement->appendChild($event_element);
		@$doc->save($this->filename);
        
    }
735498
public function removeItem(Item $item)
    {
        if ($this->items->contains($item)) {
            $this->items->removeElement($item);
            $item->removeGenre($this);
        }

        return $this;
    }
957420
public function setItem($item)
    {
        $this->items[] = $item->expose();

        $this->totalWishlistValue += $item->getTotalValueOfProduct();
    }
1029988
public function addItem(Item $item)
    {
        if ($this->has($item->name)) {
            throw new DuplicateItemNameException(
                sprintf('An item with name `%s` already exists in the menu `%s`',
                    $item->name, $item->menu->name
                )
            );
        }

        return $this->put($item->name, $item);
    }
1319711
protected function createField($item)
    {
        switch ($this->typeLookup[$item['type']]) {
            case 'password':
                return $this->createPasswordField($item);
                break;
            case 'datetime-local':
            case 'time':
                return $this->createInputField($item);
                break;
            case 'radio':
                return $this->createRadioField($item);
                break;
            default: // text
                return $this->createFormField($item);
        }
    }
1362001
private function createMenuItemCreateForm(MenuItem $entity)
    {
        $form = $this->createForm(new MenuItemType(), $entity, array(
            'action' => $this->generateUrl('admin_menu_item_create', array('id' => $entity->getMenu()->getId())),
            'method' => 'POST',
        ));

        $form->add('submit', 'submit', array('label' => 'Create'));

        return $form;
    }
501200
public function BeforeDelete($item)
    {
       $contContainers = ContentContainer::Schema()->FetchByContainer(true, $item);
       $logger = new Logger(BackendModule::Guard()->GetUser());
       foreach ($contContainers as $contContainer)
       {
           $content = $contContainer->GetContent();
           $provider = ContentTreeUtil::GetTreeProvider($content);
           $tree = new TreeBuilder($provider);
           $logger->ReportContentAction($content, Action::Delete());
           $tree->Remove($provider->ItemByContent($content));
       }
    }
1113113
public function add(Item $item)
    {
        foreach ($this->filters as $filter) {
            $this->applyFilter($filter, $item);
        }

        $this->items[] = $item;

        return $this;
    }
1192150
public function add($item)
    {
        if (is_array($item)) {
            foreach ($item as $element) {
                $this->add($element);
            }
        } else if (! $this->contains($item->path())) {
            $this->items[$item->path()] = [
                'instance' => $item,
                'listener_index' => $item->addPathListener([$this, 'updatePath'])
            ];
        }
        return $this;
    }
595694
private function addAndUpdateTitles($item)
    {
        if (isset($item['id']) && !empty($item['id'])) {
            /* @var Position $position */
            $position = $this->getDoctrine()
                ->getRepository(self::$entityName)
                ->find($item['id']);

            if (null == $position) {
                throw new EntityNotFoundException(self::$entityName, $item['id']);
            } else {
                $position->setPosition($item['position']);
            }
        } else {
            $position = new Position();
            $position->setPosition($item['position']);
            $this->getDoctrine()->getManager()->persist($position);
        }

        return $position;
    }