/**
  * Add search element to the panel.
  *
  * @param PanelRowInterface $row The row to which the element shall get added to.
  *
  * @return void
  */
 protected function parsePanelSearch(PanelRowInterface $row)
 {
     if ($row->hasElement('search')) {
         $element = $row->getElement('search');
     } else {
         $element = new DefaultSearchElementInformation();
     }
     foreach ($this->getFromDca('fields') as $property => $value) {
         if (isset($value['search'])) {
             $element->addProperty($property);
         }
     }
     if ($element->getPropertyNames() && !$row->hasElement('search')) {
         $row->addElement($element);
     }
 }
Exemple #2
0
 /**
  * Add search element to the panel.
  *
  * @param PanelRowInterface $row The row to which the element shall get added to.
  *
  * @return void
  *
  * @throws \InvalidArgumentException When the search element does not implement the correct interface.
  */
 protected function parsePanelSearch(PanelRowInterface $row)
 {
     if ($row->hasElement('search')) {
         $element = $row->getElement('search');
     } else {
         $element = new DefaultSearchElementInformation();
     }
     if (!$element instanceof SearchElementInformationInterface) {
         throw new \InvalidArgumentException('Search element does not implement the correct interface.');
     }
     foreach ($this->getInputScreenDetails()->getProperties() as $property => $value) {
         if (isset($value['info']['search'])) {
             $element->addProperty($property);
         }
     }
     if ($element->getPropertyNames() && !$row->hasElement('search')) {
         $row->addElement($element);
     }
 }