Get widget item

@param array $item

@return \AnimeDb\Bundle\CatalogBundle\Entity\Widget\Item
500953
public function getWidgetItem(array $item) {
        $entity = new ItemWidget();

        $entity->setName($this->getItemName($item));
        $entity->setLink($this->browser->getHost().$item['url']);
        $entity->setCover($this->browser->getHost().$item['image']['original']);

        $catalog_item = $this->getCatalogItem($item);
        if ($catalog_item instanceof Item) {
            $entity->setItem($catalog_item);
        } elseif ($this->filler instanceof Filler) {
            $entity->setLinkForFill($this->filler->getLinkForFill($entity->getLink()));
        }

        return $entity;
    }
1081047
public function findParent(&$items, $item)
    {
        return $items->filter(function ($element) use ($item) {
            return $item->parent_id == $element->id;
        })->first();
    }
326989
protected function parseTemplate(array $item) {
        /**
         * Check if a title has been assigned to the element
         */
        if (isset($item['title'])) {
            $this->htmlOptions['linkOptions']['title'] = $item['title'];
        }
        /**
         * Parse the template
         */
        $replace = Html::a(Html::img($item['src'], $this->htmlOptions['thumbnailOptions']), $item['href'], $this->htmlOptions['linkOptions']);
        $template = str_replace('{item}', $replace, $this->template);
        return $template;
    }
1236317
private function getUsage($item)
    {
        return $this->getCacheItem(self::CACHE_USAGE, $item, function () {
            return $this->getContext()->invokeApiGet('SHOW_USER_USAGE', ['user' => $this->getUsername()]);
        });
    }
1186854
protected function renderItem($item = [])
    {
        $tag = ArrayHelper::getValue($item, 'tag', 'div');
        $content = ArrayHelper::getValue($item, 'content', '');
        $options = ArrayHelper::getValue($item, 'options', []);
        $options = ArrayHelper::merge($this->itemOptions, $options);

        Html::addCssClass($options, ['item' => 'carousel-item']);

        return Html::tag($tag, $content, $options);
    }
512774
protected function getInvocation(array $item)
    {
        $invocation = '';

        if (isset($item['class']) && isset($item['type'])) {
            $invocation.= $item['class'].$item['type'];
        }

        $invocation.= $item['function'];
        $invocation.= '(';

        if (isset($item['args'])) {
            $args = [];

            foreach ($item['args'] as $arg) {
                $args[] = $this->varToString($arg);
            }

            $invocation.= implode(', ', $args);
        }

        $invocation.= ')';

        return $invocation;
    }
321036
private function lookupRecursive($item)
    {
        if (is_array($item)) {
            $collection = [];
            foreach ($item as $k => $v) {
                $collection[$k] = $this->lookupRecursive($v);
            }

            return $collection;
        }

        return $this->lookup($item);
    }
200417
public static function get($item)
    {
        if (isset($_POST[$item])) {
            return $_POST[$item];
        } elseif (isset($_GET[$item])) {
            return $_GET[$item];
        } else {
            return '';
        }
    }
397426
public function removeItem(Item $item)
    {
        if ($this->items->contains($item)) {
            $this->items->removeElement($item);
            $item->removeLabel($this);
        }

        return $this;
    }
588683
protected function doClean(Item $item)
    {
        $item->setIntro(
            $this->purifier->purify($item->getIntro())
        );
        $item->setContent(
            $this->purifier->purify($item->getContent())
        );

        return $item;
    }
794223
public function getItemUrl($item)
    {
        $item = $this->getItem($item);
        return $item ? $item->normalizedUrl : null;
    }
476837
public function __item($item = null)
    {
        $result = parent::__item($item);
        $result['content'] = true;
        return $result;
    }
1005765
public function getItemId(Item $item)
    {
        /* @var $source \AnimeDb\Bundle\CatalogBundle\Entity\Source */
        foreach ($item->getSources() as $source) {
            if (strpos($source->getUrl(), $this->browser->getHost()) === 0 &&
                preg_match(self::REG_ITEM_ID, $source->getUrl(), $match)
            ) {
                return (int)$match['id'];
            }
        }
        return 0;
    }
1089663
protected function itemToArray($item)
    {
        if (is_array($item)) {
            return $item;
        } elseif (method_exists($item, 'toArray')) {
            return $item->toArray();
        } elseif (method_exists($item, 'getArrayCopy')) {
            return $item->getArrayCopy();
        }

        throw new Exception\RuntimeException(sprintf(
            'Items as part of this DataSource, with type "%s" cannot be cast to an array',
            is_object($item) ? get_class($item) : gettype($item)
        ));
    }
951039
protected function recursiveToArray($item)
    {
        if (is_array($item)) {

            foreach ($item as &$subitem) {
                $subitem = $this->recursiveToArray($subitem);
            }

            unset($subitem);

            return $item;
        }

        if ($item instanceof Arrayable) {
            return $item->toArray();
        }

        return $item;
    }
469600
public function get_item_value($item) {
        if ($this->structure instanceof mod_feedback_completion) {
            return $this->structure->get_item_value($item);
        }
        return null;
    }
522056
public function item($item)
    {
        if (!$this->model) {
            $this->model = get_class($item);
        }

        $this->item = $item;

        return $this;
    }