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

getMainNodeId() private method

Searches for the main nodeId of $contentId in $versionId.
private getMainNodeId ( integer $contentId ) : integer | boolean
$contentId integer
return integer | boolean
    private function getMainNodeId($contentId)
    {
        $query = $this->handler->createSelectQuery();
        $query->select('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->eq($this->handler->quoteColumn('node_id'), $this->handler->quoteColumn('main_node_id'))));
        $statement = $query->prepare();
        $statement->execute();
        $result = $statement->fetchAll(\PDO::FETCH_ASSOC);
        if (count($result) === 1) {
            return (int) $result[0]['node_id'];
        } else {
            return false;
        }
    }