@param array $options

@return ItemInterface

@throws ApiExceptions\InvalidArgumentException
@throws ApiExceptions\BadStateException
@throws InvalidArgumentException
359974
public function createStructure(array $options): ItemInterface
    {
        /** @var ItemInterface|ItemInterface[] $menu */
        $menu = $this->factory->createItem('root');

        $menu->setChildren([
            self::ITEM__CREATE => $this->createMenuItem(
                self::ITEM__CREATE,
                [
                    'attributes' => [
                        'class' => 'btn--trigger',
                        'data-click' => '#ezrepoforms_user_create_create',
                    ],
                    'extras' => ['icon' => 'publish'],
                ]
            ),
            self::ITEM__CANCEL => $this->createMenuItem(
                self::ITEM__CANCEL,
                [
                    'attributes' => [
                        'class' => 'btn--trigger',
                        'data-click' => '#ezrepoforms_user_create_cancel',
                    ],
                    'extras' => ['icon' => 'circle-close'],
                ]
            ),
        ]);

        return $menu;
    }
520528
public function setOptions(array $options)
    {
        foreach ($options as $k => $v) {
            $this->_options[$k] = $v;
        }
        return $this;
    }
597079
protected function createElement(array $options)
    {
        $type = isset($options['type']) ? $options['type'] : null;
        unset($options['type']);

        return FactoryFields::initElement($type, $options);
    }
1124898
public function processMenu(ItemInterface $menu, array $options = []): ItemInterface
    {
        // Dispatch Event
        if ($menu->isEvent()) {
            $this->eventDispatcher->dispatch($menu->getId() . '.event', new PdMenuEvent($menu));
        }

        // Set Current URI
        $this->currentUri = $this->router->getContext()->getPathInfo();

        // Process Menu
        $this->recursiveProcess($menu, $options);

        return $menu;
    }
392839
protected function parseOptions(array $options)
    {
        $options = array_merge($this->defaultOptions, $options);

        foreach ($options as $option => $value) {
            if (! in_array($option, $this->allowedOptions, true)) {
                throw new \InvalidArgumentException("Option [$option] is not allowed.");
            }
        }

        return $options;
    }
1204534
public function getItemFormView(array $options = array())
    {
        $item = new CartItem();
        $form = $this->container->get('form.factory')->create('EcommerceBundle\Form\CartItemSimpleType', $item, $options);

        return $form->createView();
    }
1175803
public function withOptions(int ...$options): OptionsInterface
    {
        foreach ($options as $option) {
            $this->options |= $option;
        }

        return $this;
    }
326315
public function options($options = [])
    {
        if ($options instanceof Arrayable) {
            $options = $options->toArray();
        }

        $this->options = array_merge($this->options, $options);

        return $this;
    }
925188
public function setOptions(array $options)
    {
        foreach ($options as $opt => $val) {
            $this->setOption($opt, $val);
        }

        return $this;
    }
261773
public function createOptions(Array $options) {

		$this->options = [];

		foreach($options as $k => $v) {
			$this->appendOption(new SelectOptionElement($k, $v, $this));
		}

		$this->setValue();

		return $this;

	}
408394
public function ol(array $list, array $options = [], array $itemOptions = [])
    {
        return self::nestedList($list, array_merge($options, ['tag' => 'ol']), $itemOptions);
    }
446404
public function withOptions($options)
    {
        if (is_array($options)) {
            $options = new RequestOptions($options);
        }

        $this->options = $options;

        return $this;
    }
566716
public function options($options)
    {
        if (!is_array($options)) {
            throw new InvalidParamException('Array parameter expected, ' . gettype($options) . ' received.');
        }

        $this->options = $options;
        return $this;
    }
1352958
public function setAdapterOptions($options)
    {
        if (!is_array($options) && !$options instanceof AbstractOptions) {
            throw new Exception\InvalidArgumentException(sprintf(
                '"%s" expects an array or a valid instance of "%s"; received "%s"',
                __METHOD__,
                'Zend\Stdlib\AbstractOptions',
                is_object($options) ? get_class($options) : gettype($options)
            ));
        }
        $this->adapterOptions = $options;
        $this->options = $options;

        return $this;
    }
229803
public function setOptions(array $options)
    {
        foreach ($options as $key => $value) {
            $this->options[$key] = $value;
            $value && $this->object->$key = $value;
        }

        return $this;
    }
3496
public function createStructure(array $options): ItemInterface
    {
        $menu = $this->factory->createItem('root');

        $menuItems = [
            self::ITEM__SEARCH => $this->createMenuItem(
                self::ITEM__SEARCH,
                [
                    'route' => 'ezplatform.search',
                    'extras' => ['icon' => 'search'],
                ]
            ),
            self::ITEM__BROWSE => $this->createMenuItem(
                self::ITEM__BROWSE,
                [
                    'extras' => ['icon' => 'browse'],
                    'attributes' => [
                        'type' => 'button',
                        'class' => 'btn--udw-browse',
                        'data-udw-config' => $this->udwExtension->renderUniversalDiscoveryWidgetConfig('single', [
                            'type' => 'content_create',
                        ]),
                        'data-starting-location-id' => $this->configResolver->getParameter(
                            'universal_discovery_widget_module.default_location_id'
                        ),
                    ],
                ]
            ),
            self::ITEM__TREE => $this->createMenuItem(
                self::ITEM__TREE,
                [
                    'extras' => ['icon' => 'content-tree'],
                    'attributes' => [
                        'type' => 'button',
                        'class' => 'ez-btn ez-btn--toggle-content-tree',
                    ],
                ]
            ),
            self::ITEM__BOOKMARK => $this->createMenuItem(
                self::ITEM__BOOKMARK,
                [
                    'route' => 'ezplatform.bookmark.list',
                    'extras' => ['icon' => 'bookmark-manager'],
                ]
            ),
        ];

        if ($this->permissionResolver->hasAccess('content', 'restore')) {
            $menuItems[self::ITEM__TRASH] = $this->createMenuItem(
                self::ITEM__TRASH,
                [
                    'route' => 'ezplatform.trash.list',
                    'extras' => ['icon' => 'trash'],
                ]
            );
        }

        $menu->setChildren($menuItems);

        return $menu;
    }
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;
    }