Хак для sphinx запросов
Сделан для сохранения запросов where в массива а не в conditions
# core/xpdo/om/xpdoquery.class.php
/**
* Add a condition to the query.
*
* @param string $target The target clause for the condition.
* @param mixed $conditions A valid xPDO criteria expression.
* @param string $conjunction The conjunction to use when appending this condition, i.e., AND or OR.
* @param mixed $binding A value or PDO binding representation of a value for the condition.
* @param integer $condGroup A numeric identifier for associating conditions into groups.
* @return xPDOQuery Returns the instance.
*/
public $customConditions = array();
public function condition(& $target, $conditions = '1', $conjunction = xPDOQuery::SQL_AND, $binding = null, $condGroup = 0)
{
// TODO Здесь установлен хук
if ($className = $this->xpdo->loadClass($this->_class)) {
if ($this->xpdo->getPackage($className) == 'sx') {
$this->customConditions = $conditions;
}
}
$condGroup = intval($condGroup);
if (!isset ($target[$condGroup])) $target[$condGroup] = array();
try {
$target[$condGroup][] = $this->parseConditions($conditions, $conjunction);
} catch (xPDOException $e) {
$this->xpdo->log(xPDO::LOG_LEVEL_ERROR, $e->getMessage());
$this->where("2=1");
}
return $this;
}
22 сентября 2018, 21:26 269
Вы должны авторизоваться, чтобы оставлять комментарии.
Комментарии ()