protected function _buildQueryWhere(KDatabaseQuery $query) { parent::_buildQueryWhere($query); }
protected function _buildQueryWhere(KDatabaseQuery $query) { parent::_buildQueryWhere($query); if ($this->_state->enabled !== false && $this->_state->enabled !== '') { $query->where('tbl.enabled', '=', $this->_state->enabled); } //Build the query for fetching the permissions if ($this->_acl) { KFactory::get('admin::com.ninjaboard.model.people')->buildForumsPermissionsWhere($query); } // If we have an id, we shouldn't add other where statements // @TODO check if it's safe to do this if ($this->_state->id) { return; } if ($this->_state->recurse && $this->_state->path && !$this->_state->flat) { //$query->where('tbl.path', 'like', '%'.$this->_state->path); //$query->where('tbl.path', 'like', '%/'.$this->_state->path.'/%'); $query->where('tbl.path', 'like', '%/' . $this->_state->path . '/'); } else { if ($this->_state->recurse && !$this->_state->flat) { $query->where('tbl.path', '=', '/'); } } if ($this->_state->levels !== null) { $level = $this->_state->level; $levels = $this->_state->levels; $query->where('tbl.level', '>=', $level)->where('tbl.level', '<', $levels + $level); } if ($search = $this->_state->search) { $query->where("CONCAT(tbl.title, ' ', tbl.description)", 'LIKE', '%' . $search . '%'); } }