| @@ 155-177 (lines=23) @@ | ||
| 152 | * |
|
| 153 | * @param \eZ\Publish\SPI\Persistence\Content\Type\Group\UpdateStruct $group |
|
| 154 | */ |
|
| 155 | public function updateGroup(GroupUpdateStruct $group) |
|
| 156 | { |
|
| 157 | $q = $this->dbHandler->createUpdateQuery(); |
|
| 158 | $q->update( |
|
| 159 | $this->dbHandler->quoteColumn('ezcontentclassgroup') |
|
| 160 | )->set( |
|
| 161 | $this->dbHandler->quoteColumn('modified'), |
|
| 162 | $q->bindValue($group->modified, null, \PDO::PARAM_INT) |
|
| 163 | )->set( |
|
| 164 | $this->dbHandler->quoteColumn('modifier_id'), |
|
| 165 | $q->bindValue($group->modifierId, null, \PDO::PARAM_INT) |
|
| 166 | )->set( |
|
| 167 | $this->dbHandler->quoteColumn('name'), |
|
| 168 | $q->bindValue($group->identifier) |
|
| 169 | )->where( |
|
| 170 | $q->expr->eq( |
|
| 171 | $this->dbHandler->quoteColumn('id'), |
|
| 172 | $q->bindValue($group->id, null, \PDO::PARAM_INT) |
|
| 173 | ) |
|
| 174 | ); |
|
| 175 | ||
| 176 | $q->prepare()->execute(); |
|
| 177 | } |
|
| 178 | ||
| 179 | /** |
|
| 180 | * Returns the number of types in a certain group. |
|
| @@ 445-470 (lines=26) @@ | ||
| 442 | * @param string $textMD5 |
|
| 443 | * @param mixed $languageId |
|
| 444 | */ |
|
| 445 | protected function removeTranslation($parentId, $textMD5, $languageId) |
|
| 446 | { |
|
| 447 | /** @var $query \eZ\Publish\Core\Persistence\Database\UpdateQuery */ |
|
| 448 | $query = $this->dbHandler->createUpdateQuery(); |
|
| 449 | $query->update( |
|
| 450 | $this->dbHandler->quoteTable($this->table) |
|
| 451 | )->set( |
|
| 452 | $this->dbHandler->quoteColumn('lang_mask'), |
|
| 453 | $query->expr->bitAnd( |
|
| 454 | $this->dbHandler->quoteColumn('lang_mask'), |
|
| 455 | $query->bindValue(~$languageId, null, \PDO::PARAM_INT) |
|
| 456 | ) |
|
| 457 | )->where( |
|
| 458 | $query->expr->lAnd( |
|
| 459 | $query->expr->eq( |
|
| 460 | $this->dbHandler->quoteColumn('parent'), |
|
| 461 | $query->bindValue($parentId, null, \PDO::PARAM_INT) |
|
| 462 | ), |
|
| 463 | $query->expr->eq( |
|
| 464 | $this->dbHandler->quoteColumn('text_md5'), |
|
| 465 | $query->bindValue($textMD5, null, \PDO::PARAM_STR) |
|
| 466 | ) |
|
| 467 | ) |
|
| 468 | ); |
|
| 469 | $query->prepare()->execute(); |
|
| 470 | } |
|
| 471 | ||
| 472 | /** |
|
| 473 | * Marks all entries with given $id as history entries. |
|