| @@ 167-189 (lines=23) @@ | ||
| 164 | * |
|
| 165 | * @param \eZ\Publish\SPI\Persistence\Content\Type\Group\UpdateStruct $group |
|
| 166 | */ |
|
| 167 | public function updateGroup(GroupUpdateStruct $group) |
|
| 168 | { |
|
| 169 | $q = $this->dbHandler->createUpdateQuery(); |
|
| 170 | $q->update( |
|
| 171 | $this->dbHandler->quoteColumn('ezcontentclassgroup') |
|
| 172 | )->set( |
|
| 173 | $this->dbHandler->quoteColumn('modified'), |
|
| 174 | $q->bindValue($group->modified, null, \PDO::PARAM_INT) |
|
| 175 | )->set( |
|
| 176 | $this->dbHandler->quoteColumn('modifier_id'), |
|
| 177 | $q->bindValue($group->modifierId, null, \PDO::PARAM_INT) |
|
| 178 | )->set( |
|
| 179 | $this->dbHandler->quoteColumn('name'), |
|
| 180 | $q->bindValue($group->identifier) |
|
| 181 | )->where( |
|
| 182 | $q->expr->eq( |
|
| 183 | $this->dbHandler->quoteColumn('id'), |
|
| 184 | $q->bindValue($group->id, null, \PDO::PARAM_INT) |
|
| 185 | ) |
|
| 186 | ); |
|
| 187 | ||
| 188 | $q->prepare()->execute(); |
|
| 189 | } |
|
| 190 | ||
| 191 | /** |
|
| 192 | * Returns the number of types in a certain group. |
|
| @@ 453-478 (lines=26) @@ | ||
| 450 | * @param string $textMD5 |
|
| 451 | * @param mixed $languageId |
|
| 452 | */ |
|
| 453 | protected function removeTranslation($parentId, $textMD5, $languageId) |
|
| 454 | { |
|
| 455 | /** @var $query \eZ\Publish\Core\Persistence\Database\UpdateQuery */ |
|
| 456 | $query = $this->dbHandler->createUpdateQuery(); |
|
| 457 | $query->update( |
|
| 458 | $this->dbHandler->quoteTable($this->table) |
|
| 459 | )->set( |
|
| 460 | $this->dbHandler->quoteColumn('lang_mask'), |
|
| 461 | $query->expr->bitAnd( |
|
| 462 | $this->dbHandler->quoteColumn('lang_mask'), |
|
| 463 | $query->bindValue(~$languageId, null, \PDO::PARAM_INT) |
|
| 464 | ) |
|
| 465 | )->where( |
|
| 466 | $query->expr->lAnd( |
|
| 467 | $query->expr->eq( |
|
| 468 | $this->dbHandler->quoteColumn('parent'), |
|
| 469 | $query->bindValue($parentId, null, \PDO::PARAM_INT) |
|
| 470 | ), |
|
| 471 | $query->expr->eq( |
|
| 472 | $this->dbHandler->quoteColumn('text_md5'), |
|
| 473 | $query->bindValue($textMD5, null, \PDO::PARAM_STR) |
|
| 474 | ) |
|
| 475 | ) |
|
| 476 | ); |
|
| 477 | $query->prepare()->execute(); |
|
| 478 | } |
|
| 479 | ||
| 480 | /** |
|
| 481 | * Marks all entries with given $id as history entries. |
|