public function getFieldData(VersionInfo $versionInfo)
    {
        $query = $this->connection->createQueryBuilder();
        $query->select('product_id')
            ->from('ngsyliusproduct')
            ->where(
                $query->expr()->eq('contentobject_id', ':contentobject_id')
            )
            ->setParameter('contentobject_id', $versionInfo->contentInfo->id, Type::INTEGER);

        $statement = $query->execute();

        $rows = $statement->fetchAll(PDO::FETCH_ASSOC);

        return !empty($rows[0]['product_id']) ? (int) $rows[0]['product_id'] : null;
    }
public function getFieldData(VersionInfo $versionInfo)
    {
        $query = $this->connection->createQueryBuilder();
        $query->select('product_id')
            ->from('ngsyliusproduct')
            ->where(
                $query->expr()->eq('contentobject_id', ':contentobject_id')
            )
            ->setParameter('contentobject_id', $versionInfo->contentInfo->id, Type::INTEGER);

        $statement = $query->execute();

        $rows = $statement->fetchAll(PDO::FETCH_ASSOC);

        return !empty($rows[0]['product_id']) ? (int) $rows[0]['product_id'] : null;
    }
public function getFieldData ( VersionInfo $ versionInfo ) { $ query = $ this -> connection -> createQueryBuilder ( ) ; $ query -> select ( 'product_id' ) -> from ( 'ngsyliusproduct' ) -> where ( $ query -> expr ( ) -> eq ( 'contentobject_id' , ':contentobject_id' ) ) -> setParameter ( 'contentobject_id' , $ versionInfo -> contentInfo -> id , Type :: INTEGER ) ; $ statement = $ query -> execute ( ) ; $ rows = $ statement -> fetchAll ( PDO :: FETCH_ASSOC ) ; return ! empty ( $ rows [ 0 ] [ 'product_id' ] ) ? ( int ) $ rows [ 0 ] [ 'product_id' ] : null ; }
Gets the product ID stored in the field.

@param \eZ\Publish\SPI\Persistence\Content\VersionInfo $versionInfo

@return int product ID
Gets the product ID stored in the field .