/** * return where clause * * @return bool|array FALSE if no search. Else array with search type and value */ public function getClause() { if ($this->getValue() != '') { if ($this->overrideClause !== false) { return parent::getClause(); } else { return ['elementname' => $this->getName(), 'elementvalue' => $this->getValue(), 'field' => $this->getSearchField(), 'type' => 'equals', 'value' => $this->getValue()]; } } return false; }
/** * return where clause * * @return bool|array FALSE if no search. Else array with search type and value */ public function getClause() { $value = $this->getValue(); if (!empty($value)) { if ($this->overrideClause !== false) { return parent::getClause(); } else { if ($this->isMultiple()) { return ['elementname' => $this->getName(), 'elementvalue' => $this->getValue(), 'field' => $this->getSearchField(), 'type' => 'in', 'value' => $value]; } else { return ['elementname' => $this->getName(), 'elementvalue' => $this->getValue(), 'field' => $this->getSearchField(), 'type' => 'equals', 'value' => $value]; } } } return false; }