eZ\Publish\Core\FieldType\Page\PageStorage\Gateway\LegacyStorage::getContentIdByBlockId PHP Метод

getContentIdByBlockId() публичный Метод

Returns Content id for the given Block $id, or false if Block could not be found.
public getContentIdByBlockId ( integer | string $id ) : integer
$id integer | string
Результат integer
    public function getContentIdByBlockId($id)
    {
        $dbHandler = $this->getConnection();
        $query = $dbHandler->createSelectQuery();
        $query->select($dbHandler->quoteColumn('contentobject_id'))->from($dbHandler->quoteTable('ezcontentobject_tree'))->innerJoin($dbHandler->quoteTable('ezm_block'), $query->expr->eq($dbHandler->quoteColumn('node_id', 'ezm_block'), $dbHandler->quoteColumn('node_id', 'ezcontentobject_tree')))->where($query->expr->eq($dbHandler->quoteColumn('id', 'ezm_block'), $query->bindValue($id, null, PDO::PARAM_STR)));
        $stmt = $query->prepare();
        $stmt->execute();
        $contentId = $stmt->fetchColumn();
        if ($contentId === false) {
            throw new NotFoundException('Block', $id);
        }
        return $contentId;
    }