eZ\Publish\Core\Search\Common\Indexer::getContentLocationIds PHP Method

getContentLocationIds() protected method

Fetch location Ids for the given content object.
protected getContentLocationIds ( integer $contentObjectId ) : array
$contentObjectId integer
return array Location nodes Ids
    protected function getContentLocationIds($contentObjectId)
    {
        $query = $this->databaseHandler->createSelectQuery();
        $query->select('node_id')->from($this->databaseHandler->quoteTable(self::CONTENTOBJECT_TREE_TABLE))->where($query->expr->eq('contentobject_id', $contentObjectId));
        $stmt = $query->prepare();
        $stmt->execute();
        $nodeIds = $stmt->fetchAll(PDO::FETCH_COLUMN);
        return is_array($nodeIds) ? array_map('intval', $nodeIds) : [];
    }