| Versionen | |
|---|---|
| drupal7 | public UpdateQuery_sqlite::execute() |
includes/
<?php
public function 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->condition($field, $data['expression'], '<>');
// The IS NULL operator is badly managed by DatabaseCondition.
$condition->where($field . ' IS NULL');
}
elseif (is_null($data)) {
// The field will be set to NULL.
// The IS NULL operator is badly managed by DatabaseCondition.
$condition->where($field . ' IS NOT NULL');
}
else {
$condition->condition($field, $data, '<>');
// The IS NULL operator is badly managed by DatabaseCondition.
$condition->where($field . ' IS NULL');
}
}
if (count($condition)) {
$condition->compile($this->connection);
$this->condition->where((string) $condition, $condition->arguments());
}
return parent::execute();
}
?>
Kommentare
Kommentar hinzufügen