@param array $item

@return object
181554
protected function findOrCreateItem(array $item)
    {
        $object = null;
        // If the table was not truncated to begin with, find current object
        // first
        if (!$this->truncate) {
            if (!empty($this->lookupFields)) {
                $lookupConditions = array();
                foreach ($this->lookupFields as $fieldName) {
                    $lookupConditions[$fieldName] = $item[$fieldName];
                }

                $object = call_user_func($this->lookupMethod, $lookupConditions);
            } else {
                $object = $this->objectRepository->find(current($item));
            }
        }

        if (!$object) {
            return $this->getNewInstance();
        }

        return $object;
    }
660606
protected function getValue( $item )
    {
        if ( is_bool( $item ) )
            $value = $item ? "true" : "false";
        else if ( is_array( $item ) )
            $value = 'Array(' . count( $item ) . ')';
        else if ( is_numeric( $item ) )
            $value = $item;
        else if ( is_string( $item ) )
            $value = "'" . $item . "'";
        else if ( is_object( $item ) )
            $value = method_exists( $item, '__toString' ) ? (string)$item : 'Object';
        else
            $value = $item;

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

        return $this;
    }
857729
protected static function createItem(array $item)
    {
        $microformatItem = ['type' => self::createTypes($item['type']), 'lang' => null];
        self::processProperties($item, $microformatItem);
        self::processValue($item, $microformatItem);
        self::processChildren($item, $microformatItem);

        return (object)$microformatItem;
    }
487665
public function addItem($item)
    {
        if (!$this->getItems()) {
            return $this->setItems(array($item));
        } else {
            return $this->setItems(
                array_merge($this->getItems(), array($item))
            );
        }
    }
1268764
public function addItem(Item $item)
    {
        $this->items->put($item->getName(), $item);

        return $this;
    }
1074228
public function getItem($item)
	{
		return isset($this->items[$item]) ? $this->items[$item] : false;
	}
1197871
private function formAction(array $item)
    {
        $form = array(
            'name' => 'editURL',
            'caption' => ADM_EDIT,
            'width' => '100%',
            'fields' => array(
                array('type' => 'hidden', 'name' => 'update', 'value' => $item['id']),
                array('type' => 'edit', 'name' => 'url', 'label' => 'URL:', 'width' => '100%',
                    'value' => isset($item['content']) ? $item['content'] : ''),
            ),
            'buttons' => array('apply', 'cancel'),
        );
        /** @var TAdminUI $page */
        $page = Eresus_Kernel::app()->getPage();
        $html = $page->renderForm($form);
        return $html;
    }
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);
    }
333253
public function parse(array $item): array
    {
        $transform = new AssetTransform();

        foreach ($item as $k => $v) {
            $transform->$k = $v;
        }

        return [$transform, null];
    }
728318
public static function writeArrayItem($item)
    {
        $str = '';
        try {
            $str .= serialize($item);
        } catch (\Exception $e) {
            if (is_object($item)) {
                $str .= get_class($item).'#';
            }
            $str .= spl_object_hash($item);
        }
        return $str;
    }
466230
public function merge(array $item)
    {
        $this->title = $this->getValue('title', $item, $this->getTitle());
        $this->description = $this->getValue('description', $item, $this->getDescription());
        $this->moreText = $this->getValue('moreText', $item, $this->getMoreText());
        $this->url = $this->getValue('url', $item, $this->getUrl());
        $this->mediaId = $this->getValue('mediaId', $item, $this->getMediaId());

        return $this;
    }
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)
        ));
    }
794223
public function getItemUrl($item)
    {
        $item = $this->getItem($item);
        return $item ? $item->normalizedUrl : null;
    }
19229
private function parseOption(array $item) : Option
    {
        $name = $item['option'];

        $characteristic = $item['characteristic'] ?? null;

        if (isset($characteristic))
        {
            $characteristic = self::optionCharacteristic($characteristic);
        }

        $type = $item['type'] ?? null;

        $default = $item['default'] ?? null;

        $description = $item['description'] ?? null;

        $fixedName = $item['name'] ?? null;

        $option = new Option($name, $characteristic, $type, $default);

        if (isset($description))
        {
            $option->setDescription($description);
        }

        if (isset($fixedName))
        {
            if ($fixedName[0] === '-')
            {
                throw new OptionLoaderException(
                    "An option's fixed name may not start with a `-`.",
                    $item
                );
            }

            $option->setFixedName($fixedName);
        }

        if (isset($item['aliases']))
        {
            foreach ($item['aliases'] as $alias)
            {
                $aliasCharacteristic = $alias['characteristic'] ?? null;

                if (isset($aliasCharacteristic))
                {
                    $aliasCharacteristic = self::optionCharacteristic(
                        $aliasCharacteristic
                    );
                }

                $aliasName = $alias['option'] ?? null;

                if ( ! isset($aliasName))
                {
                    throw new OptionLoaderException(
                        "An alias must contain its own option name.",
                        $alias
                    );
                }

                new AliasOption($aliasName, $aliasCharacteristic, $option);
            }
        }

        if (isset($fixedName))
        {
            $this->optionCatalogue[$fixedName] = $option;
        }

        $this->optionCatalogue[$option->getPrintableName()] = $option;

        return $option;
    }
397426
public function removeItem(Item $item)
    {
        if ($this->items->contains($item)) {
            $this->items->removeElement($item);
            $item->removeLabel($this);
        }

        return $this;
    }
136182
public function importItem(Item $item)
    {
        foreach ($this->data as $templateData) {
            foreach ($item->getData() as $itemData) {
                if ($itemData->getName() === $templateData->getName()) {
                    $templateData->setName($itemData->getName());
                    $templateData->setValue($itemData->getValue());
                    $templateData->setPrompt($itemData->getPrompt());
                }
            }
        }

        return $this;
    }