Generate item document.

@param Item $item
188701
public function addItem(Item $item)
    {
        $itemUUID = $item->composeUUID();

        $this->elementsToUpdate[$itemUUID] = $item;
        unset($this->elementsToDelete[$itemUUID]);
    }
957420
public function setItem($item)
    {
        $this->items[] = $item->expose();

        $this->totalWishlistValue += $item->getTotalValueOfProduct();
    }
709685
public function addItem(Item $item) {
        if(empty($item->title) && empty($item->description)) {
            throw new Exception('At least one of title or description must be defined.');
        }

        $this->items[] = $item;
    }
1157920
public function deleteItemAction(Item $item) {
        $em = $this->getDoctrine()->getManager();
        $em->remove($item);
        $em->flush();

        $view = $this->view();

        return $this->handleView($view);
    }
776009
protected function printFeedbackItem(string $item)
    {
        echo $item;
        ++$this->column;
        ++$this->casesProcessed;
        if ($this->column === $this->maxColumn) {
            echo $this->getProgress();
            $this->println();
        }
    }
1302268
public function add($item)
    {
        if ($item instanceof ItemInterface) {
            $this->items[] = $item;
        } else {
            $this->items[] = new MulticardsItem($item);
        }
    }
1352921
public function setItem(Item $item = null)
    {
        if ($this->item !== $item) {
            // romove link on this item for old item
            if ($this->item instanceof Item) {
                $tmp = $this->item;
                $this->item = null;
                $tmp->removeName($this);
            }
            $this->item = $item;
            // add link on this item
            if ($item instanceof Item) {
                $this->item->addName($this);
            }
        }

        return $this;
    }
656698
protected function generateItems($items)
    {
        foreach ($items as $id => &$values) {
            $values = $this->setDefaultValues($id, $values);

            if (!$this->checkAccess($values)) {
                unset($items[$id]);
                continue;
            }

            $values['title'] = $this->getTitle($id, $values['title']);

            $values['url'] = $this->generateUrl($values);

            if (isset($values['submenu'])) {
                $values['submenu'] = $this->generateItems($values['submenu']);
            }

            if ($this->isActiveUrl($values)) {
                $values['active'] = true;
                $this->currentId = $id;
            } elseif (isset ($values['submenu'])) {
                // Check if there is an active item in the submenu, if
                // so it'll mark the current item as active as well.
                foreach ($values['submenu'] as $subitem) {
                    if ($subitem['active']) {
                        $values['active'] = true;
                        break;
                    }
                }
            }

            if ($values['active']) {
                $values['class'] .= ' '.$this->activeClass;
            }

            if ($values['submenu']) {
                $values['class'] .= ' '.$this->dropDownClass;
            }

            $values['class'] = trim($values['class']);

            unset(
                $values['callback'], $values['logged'], $values['roles'], $values['secure'],
                $values['params'], $values['route'], $values['action'], $values['full_url'],
                $values['allows'], $values['check'], $values['denies'], $values['exact']
            );
        }

        return $items;
    }
306449
public function refreshIdentifiers(Item $item)
    {
        // refresh self id
        $item->refreshUuid();

        // refresh objects ids
        foreach ($item->getObjects() as $object) {
            $object->refreshUuid();
        }

        // refresh hints ids
        foreach ($item->getHints() as $hint) {
            $hint->refreshUuid();
        }

        if (1 === preg_match('#^application\/x\.[^/]+\+json$#', $item->getMimeType())) {
            // it's a question
            $definition = $this->itemDefinitions->get($item->getMimeType());
        } else {
            // it's a content
            $definition = $this->itemDefinitions->get(ItemType::CONTENT);
        }

        $definition->refreshIdentifiers($item->getInteraction());
    }
522056
public function item($item)
    {
        if (!$this->model) {
            $this->model = get_class($item);
        }

        $this->item = $item;

        return $this;
    }
227074
public function setItem(Item $item = null)
    {
        if ($this->item !== $item) {
            // romove link on this item for old item
            if ($this->item instanceof Item) {
                $tmp = $this->item;
                $this->item = null;
                $tmp->removeSource($this);
            }
            $this->item = $item;
            // add link on this item
            if ($item instanceof Item) {
                $this->item->addSource($this);
            }
        }

        return $this;
    }
476837
public function __item($item = null)
    {
        $result = parent::__item($item);
        $result['content'] = true;
        return $result;
    }
1353393
public function addItem(Item $item)
    {
        if (!$this->items->contains($item)) {
            $this->items->add($item);
            $item->setType($this);
        }

        return $this;
    }
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);
        }
    }
1057126
public function addItem(Item $item)
	{
		$item->source = $this->link;

		$this->items[] = $item;

		return $this;
	}
969098
protected function convertItem($item)
    {
        foreach ($item as $key => $value) {
            if (!isset($this->converters[$key])) {
                continue;
            }

            foreach ($this->converters[$key] as $converter) {
                $item[$key] = call_user_func($converter, $item[$key]);
            }
        }

        return $item;
    }
258858
protected function setImagesFromContent(Item $item)
    {
        $allImages = $this->getImages($item->getContent());
        $images = array();

        foreach ($allImages as $image) {
            if ($this->isOnIgnoredPatterns($image)) {
                continue;
            }
            $images[$image] = $image;
        }

        $item->setExtra('images', array_values($images));
    }