QuickSearch::postInit PHP 메소드

postInit() 공개 메소드

Process received filtering parameters after init phase.
public postInit ( ) : Model | void
리턴 Model | void
    public function postInit()
    {
        parent::postInit();
        if (!($v = trim($this->get('q')))) {
            return;
        }
        if ($this->view->model->hasMethod('addConditionLike')) {
            return $this->view->model->addConditionLike($v, $this->fields);
        }
        if ($this->view->model && $this->view->model instanceof SQL_Model) {
            $q = $this->view->model->_dsql();
        } else {
            $q = $this->view->dq;
        }
        $or = $q->orExpr();
        foreach ($this->fields as $field) {
            $or->where($field, 'like', '%' . $v . '%');
        }
        $q->having($or);
    }