/** * Implements QueryConditionInterface::where(). */ public function where($snippet, $args = array()) { $this->condition->where($snippet, $args); return $this; }
public function execute() { if (!empty($this->queryOptions['sqlite_return_matched_rows'])) { return parent::execute(); } // Get the fields used in the update query, and remove those that are already // in the condition. $fields = $this->expressionFields + $this->fields; $this->removeFieldsInCondition($fields, $this->condition); // Add the inverse of the fields to the condition. $condition = new DatabaseCondition('OR'); foreach ($fields as $field => $data) { if (is_array($data)) { // The field is an expression. $condition->where($field . ' <> ' . $data['expression']); $condition->isNull($field); } elseif (!isset($data)) { // The field will be set to NULL. $condition->isNull($field); } else { $condition->condition($field, $data, '<>'); $condition->isNull($field); } } if (count($condition)) { $condition->compile($this->connection, $this); $this->condition->where((string) $condition, $condition->arguments()); } return parent::execute(); }
public function having($snippet, $args = array()) { $this->having->where($snippet, $args); return $this; }