/** * {@inheritdoc} */ public function layout() : Container { if ($this->isRequired() == false) { $this->widgetOptions->addData('plugin', ['allowClear' => true]); } $container = parent::layout(); if ($this->widgetOptions->count()) { $instance = $this->getFieldContainer($container); $instance->add($this->widgetOptions); } return $container; }
/** * @param string $query * * @return $this|self */ public function setQuery(string $query) : self { $this->widgetOptions->addData('query', $query); return $this; }
/** * @param AbstractShape $shape * * @return $this|self */ public function addShape(AbstractShape $shape) { $this->widgetOptions->addData('shapes', [$shape]); return $this; }
/** * Vertical slide mode * * @param bool $vertical * * @return $this|self */ public function setVertical(bool $vertical = true) : self { $this->widgetOptions->addData('vertical', $vertical); return $this; }