/** * Adds search conditions into query * * @param RM_Db_Query query * @return void **/ protected function _addConditionsToQuery(RM_Db_Query $query) { $query->where('(' . implode(' OR ', array_keys($this->_getConditions())) . ')', array_values($this->_getConditions())); }
protected function _addDependenceOfBricksToQuery(RM_Db_Query $q, array $brickList) { $nameList = array(); foreach ($brickList as $brick) { if (!isNull($brick)) { $nameList[] = $brick->getBrickSystemName(); } } if ($nameList) { $q->join('v', 'LEFT JOIN ' . $this->table('dependency') . ' dep on dep.value_id=v.id and dep.brick_code in (' . sqlBinds($nameList) . ')', $nameList); $q->what('dep.brick_code'); $q->where('dep.value_id is null'); } }