{@inheritDoc}
@see \Ajax\common\html\HtmlCollection::createItem()
339143
protected function createItem($value){
		$col=new HtmlGridCol($this->identifier."-col-".($this->count()+1),$value);
		return $col;
	}
1026199
protected function _createItem( array $entry )
	{
		$item = $this->_manager->createItem();

		foreach( $entry as $name => $value )
		{
			switch( $name )
			{
				case 'order.base.address.type': $item->setType( $value ); break;
				case 'order.base.address.baseid': $item->setBaseId( $value ); break;
				case 'order.base.address.addressid': $item->setAddressId( $value ); break;

				case 'order.base.address.vatid': $item->setVatID( $value ); break;
				case 'order.base.address.company': $item->setCompany( $value ); break;
				case 'order.base.address.salutation': $item->setSalutation( $value ); break;
				case 'order.base.address.title': $item->setTitle( $value ); break;
				case 'order.base.address.firstname': $item->setFirstname( $value ); break;
				case 'order.base.address.lastname': $item->setLastname( $value ); break;
				case 'order.base.address.address1': $item->setAddress1( $value ); break;
				case 'order.base.address.address2': $item->setAddress2( $value ); break;
				case 'order.base.address.address3': $item->setAddress3( $value ); break;
				case 'order.base.address.postal': $item->setPostal( $value ); break;
				case 'order.base.address.city': $item->setCity( $value ); break;
				case 'order.base.address.state': $item->setState( $value ); break;
				case 'order.base.address.countryid': $item->setCountryId( $value ); break;
				case 'order.base.address.languageid': $item->setLanguageId( $value ); break;
				case 'order.base.address.telephone': $item->setTelephone( $value ); break;
				case 'order.base.address.telefax': $item->setTelefax( $value ); break;
				case 'order.base.address.website': $item->setWebsite( $value ); break;
				case 'order.base.address.email': $item->setEmail( $value ); break;
			}
		}

		return $item;
	}
185994
protected function createNewItem($itemData)
    {
        $item = array_flip($this->columns);

        foreach ($item as $key => $value) {
            if (isset($itemData[$key])) {
                $item[$key] = $itemData[$key];
            } else {
                $item[$key] = null;
            }
        }

        return $item;
    }
754043
protected function createItem($value){
		if(\is_object($value)===false){
			$value=new HtmlSemDoubleElement("","div","content",$value);
		}
		return new HtmlShapeItem("side-".$this->identifier."-".$this->count(), $value);
	}
60064
public function createItemMenu(array $options)
    {
        if (empty($options['item']) || !($options['item'] instanceof Item)) {
            throw new \InvalidArgumentException('Item is not found');
        }

        /* @var $item Item */
        $item = $options['item'];

        /* @var $menu ItemInterface */
        $menu = $this->factory
            ->createItem('root')
            ->setUri($this->request_stack->getMasterRequest()->getRequestUri());
        $params = [
            'id' => $item->getId(),
            'name' => $item->getUrlName(),
        ];

        $menu
            ->addChild('Change record', ['route' => 'item_change', 'routeParameters' => $params])
            ->setLinkAttribute('class', 'icon-label icon-edit');

        // add settings plugin items
        /* @var $plugin ItemPluginInterface */
        foreach ($this->plugin_item->getPlugins() as $plugin) {
            $plugin->buildMenu($menu, $options['item']);
        }

        $menu->addChild('Delete record', ['route' => 'item_delete', 'routeParameters' => $params])
            ->setLinkAttribute('class', 'icon-label icon-delete')
            ->setLinkAttribute('data-message', $this->translator->trans(
                'Are you sure want to delete %name%?',
                ['%name%' => $item->getName()]
            ));

        return $menu;
    }
1349871
public static function create($value = null)
    {
        $item = new self();
        if ($value) {
            $item->setValue($value);
        }

        return $item;
    }
1176088
public function createQtiItem()
    {
        try {
            // Check if it's post method
            if ($this->getRequestMethod()!=Request::HTTP_POST) {
                throw new \common_exception_NotImplemented('Only post method is accepted to create empty item.');
            }

            $label = $this->hasRequestParameter('label') ? $this->getRequestParameter('label') : '';
            // Call service to import package
            $item = $this->getDestinationClass()->createInstance($label);
            
            //set the QTI type
            $itemService = \taoItems_models_classes_ItemsService::singleton();
            $itemService->setItemModel($item, $this->getResource(ItemModel::MODEL_URI));

            $this->returnSuccess($item->getUri());

        } catch (\Exception $e) {
            $this->returnFailure($e);
        }
    }
137590
protected function createItem(Model $item, $data)
    {
        $this->beforeAssignData($item, $data);
        $item->assign($data, null, $this->whitelistCreate());
        $this->afterAssignData($item, $data);

        $this->beforeSave($item);
        $this->beforeCreate($item);

        $success = $item->create();

        if ($success) {

            $this->afterCreate($item);
            $this->afterSave($item);
        }

        return $success ? $item : null;
    }
720007
public function iStartCreatingNew(string $newItemType, ?string $containerItem = null): void
    {
        if (!array_key_exists($newItemType, $this->itemCreateMapping)) {
            throw new \InvalidArgumentException(sprintf('Unrecognized item type name: %s', $newItemType));
        }
        PageObjectFactory::createPage($this->utilityContext, $this->itemCreateMapping[$newItemType], $containerItem)
            ->startCreatingItem();
    }
516695
public function &createItem($name, $text, $url = '')
    {
        $menu_item = new MenuItem();

        $menu_item->setName($name);
        $menu_item->setText($text);

        if ($url) {
            $menu_item->setUrl($url);
        }

        $this->items[$name] = $menu_item;

        return $this->items[$name];
    }
230694
private function createLinkManagerMenuItem(): ?ItemInterface
    {
        if (!$this->permissionResolver->hasAccess('url', 'view')) {
            return null;
        }

        return $this->factory->createItem(
            self::ITEM_CONTENT__LINK_MANAGER,
            [
                'route' => 'ezplatform.link_manager.list',
                'extras' => [
                    'routes' => [
                        'edit' => 'ezplatform.link_manager.edit',
                        'view' => 'ezplatform.link_manager.view',
                    ],
                ],
            ]
        );
    }
1085467
protected function createItem($value) {
		$title=$value;
		$content="";
		if(\is_array($value)){
			$title=@$value[0];$content=@$value[1];
		}
		$itemO=new HtmlAccordionMenuItem("item-".$this->identifier."-".$this->count(), $title, $content);
		return $itemO->setClass("item");
	}
595691
protected function _createItem( array $entry )
	{
		$item = $this->_manager->createItem();

		foreach( (array) $entry as $name => $value )
		{
			switch( $name )
			{
				case 'catalog.list.id': $item->setId( $value ); break;
				case 'catalog.list.domain': $item->setDomain( $value ); break;
				case 'catalog.list.parentid': $item->setParentId( $value ); break;
				case 'catalog.list.position': $item->setPosition( $value ); break;
				case 'catalog.list.config': $item->setConfig( (array) $value ); break;
				case 'catalog.list.status': $item->setStatus( $value ); break;
				case 'catalog.list.typeid': $item->setTypeId( $value ); break;
				case 'catalog.list.refid': $item->setRefId( $value ); break;
				case 'catalog.list.datestart':
					if( $value != '' )
					{
						$value = str_replace( 'T', ' ', $value );
						$entry->{'catalog.list.datestart'} = $value;
						$item->setDateStart( $value );
					}
					break;
				case 'catalog.list.dateend':
					if( $value != '' )
					{
						$value = str_replace( 'T', ' ', $value );
						$entry->{'catalog.list.dateend'} = $value;
						$item->setDateEnd( $value );
					}
					break;
			}
		}

		return $item;
	}
593151
public function createStructure(array $options): ItemInterface
    {
        /** @var bool $location */
        $canDelete = $this->permissionResolver->hasAccess('content', 'cleantrash');
        /** @var int $trashItemsCount */
        $trashItemsCount = $this->trashService->findTrashItems(new Query())->count;
        /** @var ItemInterface|ItemInterface[] $menu */
        $menu = $this->factory->createItem('root');

        $menu->addChild(
            $this->createMenuItem(self::ITEM__EMPTY, [
                'extras' => ['icon' => 'trash-empty'],
                'attributes' => $canDelete > 0 && $trashItemsCount > 0
                    ? ['data-toggle' => 'modal', 'data-target' => '#confirmEmptyTrash']
                    : ['class' => 'disabled'],
            ])
        );

        return $menu;
    }
966024
public function itemCreate(Item $item)
    {
        $response = $this->getGuzzleClient()
            ->post(
                '/items',
                array_merge($this->setQuery(), $this->setBody($item))
            );

        return $this->serializer->deserialize(
            $response->getBody()->getContents(),
            Item::class,
            'json'
        );
    }
1276120
public function setItem(Item $item)
    {
        $this->childOf = $item->id;
        $this->_item = $item;
        
        return $this;
    }
171548
public function createStructure(array $options): ItemInterface
    {
        /** @var ItemInterface|ItemInterface[] $menu */
        $menu = $this->factory->createItem('root');

        /** @var Location $location */
        $location = $options['location'];
        /** @var Content $content */
        $content = $options['content'];
        /** @var Language $language */
        $language = $options['language'];
        /** @var Location $parentLocation */
        $parentLocation = $options['parent_location'];

        $target = (new Target\Builder\VersionBuilder())->translateToAnyLanguageOf([$language->languageCode])->build();
        $canPublish = $this->permissionResolver->canUser('content', 'publish', $content, [$target]);
        $canEdit = $this->permissionResolver->canUser('content', 'edit', $content, [$target]);
        $canDelete = $this->permissionResolver->canUser('content', 'versionremove', $content);

        $publishAttributes = [
            'class' => self::BTN_TRIGGER_CLASS,
            'data-click' => '#ezrepoforms_content_edit_publish',
        ];
        $editAttributes = [
            'class' => self::BTN_TRIGGER_CLASS,
            'data-click' => '#ezrepoforms_content_edit_saveDraft',
        ];
        $deleteAttributes = [
            'class' => self::BTN_TRIGGER_CLASS,
            'data-click' => '#ezrepoforms_content_edit_cancel',
        ];

        $items = [
            self::ITEM__PUBLISH => $this->createMenuItem(
                self::ITEM__PUBLISH,
                [
                    'attributes' => $canEdit && $canPublish
                        ? $publishAttributes
                        : array_merge($publishAttributes, self::BTN_DISABLED_ATTR),
                    'extras' => [
                        'icon' => 'publish',
                        'orderNumber' => 10,
                    ],
                ]
            ),
            self::ITEM__SAVE_DRAFT => $this->createMenuItem(
                self::ITEM__SAVE_DRAFT,
                [
                    'attributes' => $canEdit
                        ? $editAttributes
                        : array_merge($editAttributes, self::BTN_DISABLED_ATTR),
                    'extras' => [
                        'icon' => 'save',
                        'orderNumber' => 50,
                    ],
                ]
            ),
        ];

        $items[self::ITEM__PREVIEW] = $this->getContentPreviewItem(
            $location,
            $content,
            $language,
            $parentLocation
        );

        $items[self::ITEM__CANCEL] = $this->createMenuItem(
            self::ITEM__CANCEL,
            [
                'attributes' => $canDelete
                    ? $deleteAttributes
                    : array_merge($deleteAttributes, self::BTN_DISABLED_ATTR),
                'extras' => [
                    'icon' => 'circle-close',
                    'orderNumber' => 70,
                ],
            ]
        );

        $menu->setChildren($items);

        return $menu;
    }