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

historizeId() public method

This method is used by Handler::locationMoved(). Each row is separately historized because future publishing needs to be able to take over history entries safely.
public historizeId ( mixed $id, mixed $link )
$id mixed
$link mixed
    public function historizeId($id, $link)
    {
        /** @var $query \eZ\Publish\Core\Persistence\Database\SelectQuery */
        $query = $this->dbHandler->createSelectQuery();
        $query->select($this->dbHandler->quoteColumn('parent'), $this->dbHandler->quoteColumn('text_md5'))->from($this->dbHandler->quoteTable($this->table))->where($query->expr->lAnd($query->expr->eq($this->dbHandler->quoteColumn('is_alias'), $query->bindValue(0, null, \PDO::PARAM_INT)), $query->expr->eq($this->dbHandler->quoteColumn('is_original'), $query->bindValue(1, null, \PDO::PARAM_INT)), $query->expr->eq($this->dbHandler->quoteColumn('action_type'), $query->bindValue('eznode', null, \PDO::PARAM_STR)), $query->expr->eq($this->dbHandler->quoteColumn('link'), $query->bindValue($id, null, \PDO::PARAM_INT))));
        $statement = $query->prepare();
        $statement->execute();
        $rows = $statement->fetchAll(\PDO::FETCH_ASSOC);
        foreach ($rows as $row) {
            $this->historize($row['parent'], $row['text_md5'], $link);
        }
    }