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

loadPathData() public method

Loads all data for the path identified by given $id.
public loadPathData ( mixed $id ) : array
$id mixed
return array
    public function loadPathData($id)
    {
        $pathData = array();
        while ($id != 0) {
            /** @var $query \eZ\Publish\Core\Persistence\Database\SelectQuery */
            $query = $this->dbHandler->createSelectQuery();
            $query->select($this->dbHandler->quoteColumn('parent'), $this->dbHandler->quoteColumn('lang_mask'), $this->dbHandler->quoteColumn('text'))->from($this->dbHandler->quoteTable($this->table))->where($query->expr->eq($this->dbHandler->quoteColumn('id'), $query->bindValue($id, null, \PDO::PARAM_INT)));
            $statement = $query->prepare();
            $statement->execute();
            $rows = $statement->fetchAll(\PDO::FETCH_ASSOC);
            if (empty($rows)) {
                // Normally this should never happen
                // @todo remove throw when tested
                $path = implode('/', $pathData);
                throw new \RuntimeException("Path ({$path}...) is broken, last id is '{$id}': " . __METHOD__);
            }
            $id = $rows[0]['parent'];
            array_unshift($pathData, $rows);
        }
        return $pathData;
    }