コード例 #1
0
ファイル: Checkbox.php プロジェクト: ameos/ameos_form
 /**
  * return where clause
  *
  * @return	bool|array FALSE if no search. Else array with search type and value
  */
 public function getClause()
 {
     $values = $this->getValue();
     if (!empty($values)) {
         if ($this->overrideClause !== false) {
             return parent::getClause();
         } else {
             $clauses = [];
             if (is_array($values)) {
                 foreach ($values as $value) {
                     $clauses[] = ['field' => $this->getSearchField(), 'type' => 'contains', 'value' => $value];
                 }
             }
             return ['elementname' => $this->getName(), 'elementvalue' => $this->getValue(), 'field' => $this->getSearchField(), 'type' => 'logicalOr', 'clauses' => $clauses];
         }
     }
     return false;
 }