@param array $options

@return \Knp\Menu\ItemInterface

@throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
972487
public function createStructure(array $options): ItemInterface
    {
        /** @var ItemInterface|ItemInterface[] $menu */
        $menu = $this->factory->createItem('root');

        $contentMenuItems = $this->getContentMenuItems();
        $menu->addChild($this->factory->createItem(self::ITEM_CONTENT, []));
        $menu[self::ITEM_CONTENT]->setChildren($contentMenuItems);

        $adminMenuItems = $this->getAdminMenuItems();
        $menu->addChild($this->factory->createItem(self::ITEM_ADMIN, []));
        $menu[self::ITEM_ADMIN]->setChildren($adminMenuItems);

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

        $menu->setChildren([
            self::ITEM__ACCOUNT => $this->createMenuItem(
                self::ITEM__ACCOUNT,
                [
                    'route' => 'edgar.ezuiprofile.account',
                    'extras' => ['icon' => 'author'],
                ]
            ),
            self::ITEM__SECURITY => $this->createMenuItem(
                self::ITEM__SECURITY,
                [
                    'route' => 'edgar.ezuiprofile.security',
                    'extras' => ['icon' => 'lock'],
                ]
            ),
            self::ITEM__CONTENT => $this->createMenuItem(
                self::ITEM__CONTENT,
                [
                    'route' => 'edgar.ezuiprofile.content',
                    'extras' => ['icon' => 'personalize-content'],
                ]
            ),
        ]);

        return $menu;
    }
908431
public function setOptions(array $options)
    {
        foreach ($options as $index=>$val) {
            if (property_exists($this, $index)) {
                $this->{$index} = $val;
            }
        }
        return $this;
    }
333198
protected function resolveOptions(array $options = array())
    {
        $resolver = new OptionsResolver;
        $this->setDefaultOptions($resolver);

        if (!empty($this->options)) {
            $resolver->setDefaults($this->options);
        }

        return $resolver->resolve($options);
    }
787214
protected function _addMenu(ItemInterface $menu, array $options)
    {
        $this->_menus[$menu->getName()] = $menu;
        $this->_menuConfigurations->attach($menu, $options);
    }
940849
public function createOptions(Array $options) {

		$this->options = [];

		foreach($options as $value => $label) {
			$this->appendOption(new RadioOptionElement($value, new LabelElement($label)));
		}
		
		return $this;

	}
209517
public function addOptions(array $options) : Getopt
    {
        if (!empty($this->options)){
            $this->options = array_merge($this->options, $options);
        }
        else{
            $this->options = $options;
        }
        return $this;
    }
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;
    }
195005
protected function set_options( array $options = [ ] ) {

		foreach ( $options as $key => $value ) {
			if ( ! array_key_exists( $key, $this->options ) ) {
				throw new \InvalidArgumentException(
					sprintf( 'The option "%1$s" does not have a matching option[%1$s] array key', $key ),
					1.0
				);
				continue;
			}

			$this->options[ $key ] = $value;
		}
	}
1000923
protected function createMenuItem(string $id, array $options): ?ItemInterface
    {
        return $this->factory->createItem($id, $options);
    }
1040283
public function createStructure(array $options): ItemInterface
    {
        /** @var \eZ\Publish\API\Repository\Values\ContentType\ContentType $contentType */
        $contentType = $options['content_type'];

        /** @var \Knp\Menu\ItemInterface $menu */
        $menu = $this->factory->createItem('root');

        $editAttributes = [
            'class' => 'ez-btn--extra-actions ez-btn--edit',
            'data-actions' => 'edit',
        ];
        $canEdit = $this->permissionResolver->canUser(
            'class',
            'update',
            $contentType
        ) && $this->permissionResolver->hasAccess('class', 'create');

        $menu->addChild(
            $this->createMenuItem(
                self::ITEM__EDIT,
                [
                    'extras' => ['icon' => 'edit'],
                    'attributes' => $canEdit
                        ? $editAttributes
                        : array_merge($editAttributes, ['disabled' => 'disabled']),
                ]
            )
        );

        return $menu;
    }
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;
    }
566716
public function options($options)
    {
        if (!is_array($options)) {
            throw new InvalidParamException('Array parameter expected, ' . gettype($options) . ' received.');
        }

        $this->options = $options;
        return $this;
    }
727513
public function setOptions($options)
    {
        if (!is_int($options) && !is_null($options)) {
            throw new InvalidArgumentException('Invalid options.');
        }

        $this->options = $options ?: 0;

        $this->handleChangedParameters();

        return $this;
    }
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;
    }
996848
public function options($options = [])
    {
        if (!$this->keyAsValue) {
            return parent::options($options);
        }

        if ($options instanceof Collection) {
            $options = $options->pluck($this->visibleColumn, $this->key)->toArray();
        }

        if ($options instanceof Arrayable) {
            $options = $options->toArray();
        }

        $this->options = $options + $this->options;

        return $this;
    }
301549
private function resolveOptions(array $options = [])
    {
        $resolver = new OptionsResolver();
        $this->configure($resolver);

        return $resolver->resolve($options);
    }