eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway\DoctrineDatabase::getFallbackMainNodeData PHP Method

getFallbackMainNodeData() public method

This returns lowest node id for content identified by $contentId, and not of the node identified by given $locationId (current main node). Assumes that content has more than one location.
public getFallbackMainNodeData ( mixed $contentId, mixed $locationId ) : array
$contentId mixed
$locationId mixed
return array
    public function getFallbackMainNodeData($contentId, $locationId)
    {
        $query = $this->handler->createSelectQuery();
        $query->select($this->handler->quoteColumn('node_id'), $this->handler->quoteColumn('contentobject_version'), $this->handler->quoteColumn('parent_node_id'))->from($this->handler->quoteTable('ezcontentobject_tree'))->where($query->expr->lAnd($query->expr->eq($this->handler->quoteColumn('contentobject_id'), $query->bindValue($contentId, null, \PDO::PARAM_INT)), $query->expr->neq($this->handler->quoteColumn('node_id'), $query->bindValue($locationId, null, \PDO::PARAM_INT))))->orderBy('node_id', SelectQuery::ASC)->limit(1);
        $statement = $query->prepare();
        $statement->execute();
        return $statement->fetch(\PDO::FETCH_ASSOC);
    }