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

loadAutogeneratedEntry() public method

Loads autogenerated entry id by given $action and optionally $parentId.
public loadAutogeneratedEntry ( string $action, mixed | null $parentId = null ) : array
$action string
$parentId mixed | null
return array
    public function loadAutogeneratedEntry($action, $parentId = null)
    {
        /** @var $query \eZ\Publish\Core\Persistence\Database\SelectQuery */
        $query = $this->dbHandler->createSelectQuery();
        $query->select('*')->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))));
        if (isset($parentId)) {
            $query->where($query->expr->eq($this->dbHandler->quoteColumn('parent'), $query->bindValue($parentId, null, \PDO::PARAM_INT)));
        }
        $statement = $query->prepare();
        $statement->execute();
        return $statement->fetch(\PDO::FETCH_ASSOC);
    }