eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Gateway\DoctrineDatabase::cleanupAfterPublish PHP Method

cleanupAfterPublish() public method

If language mask of the found entry is composite (meaning it consists of multiple language ids) given $languageId will be removed from mask. Otherwise entry will be marked as history.
public cleanupAfterPublish ( string $action, mixed $languageId, mixed $newId, mixed $parentId, string $textMD5 )
$action string
$languageId mixed
$newId mixed
$parentId mixed
$textMD5 string
    public function cleanupAfterPublish($action, $languageId, $newId, $parentId, $textMD5)
    {
        /** @var $query \eZ\Publish\Core\Persistence\Database\SelectQuery */
        $query = $this->dbHandler->createSelectQuery();
        $query->select($this->dbHandler->quoteColumn('parent'), $this->dbHandler->quoteColumn('text_md5'), $this->dbHandler->quoteColumn('lang_mask'))->from($this->dbHandler->quoteTable($this->table))->where($query->expr->lAnd($query->expr->eq($this->dbHandler->quoteColumn('action'), $query->bindValue($action, null, \PDO::PARAM_STR)), $query->expr->eq($this->dbHandler->quoteColumn('is_original'), $query->bindValue(1, null, \PDO::PARAM_INT)), $query->expr->eq($this->dbHandler->quoteColumn('is_alias'), $query->bindValue(0, null, \PDO::PARAM_INT)), $query->expr->gt($query->expr->bitAnd($this->dbHandler->quoteColumn('lang_mask'), $query->bindValue($languageId, null, \PDO::PARAM_INT)), 0), $query->expr->not($query->expr->lAnd($query->expr->eq($this->dbHandler->quoteColumn('parent'), $query->bindValue($parentId, null, \PDO::PARAM_INT)), $query->expr->eq($this->dbHandler->quoteColumn('text_md5'), $query->bindValue($textMD5, null, \PDO::PARAM_STR))))));
        $statement = $query->prepare();
        $statement->execute();
        $row = $statement->fetch(\PDO::FETCH_ASSOC);
        if (!empty($row)) {
            // If language mask is composite (consists of multiple languages) then remove given language from entry
            if ($row['lang_mask'] & ~($languageId | 1)) {
                $this->removeTranslation($row['parent'], $row['text_md5'], $languageId);
            } else {
                // Otherwise mark entry as history
                $this->historize($row['parent'], $row['text_md5'], $newId);
            }
        }
    }