CrEOF\Spatial\DBAL\Platform\AbstractPlatform::convertBinaryToPHPValue PHP Method

convertBinaryToPHPValue() public method

public convertBinaryToPHPValue ( CrEOF\Spatial\DBAL\Types\AbstractSpatialType $type, string $sqlExpr ) : CrEOF\Spatial\PHP\Types\Geometry\GeometryInterface
$type CrEOF\Spatial\DBAL\Types\AbstractSpatialType
$sqlExpr string
return CrEOF\Spatial\PHP\Types\Geometry\GeometryInterface
    public function convertBinaryToPHPValue(AbstractSpatialType $type, $sqlExpr)
    {
        $parser = new BinaryParser($sqlExpr);
        return $this->newObjectFromValue($type, $parser->parse());
    }

Usage Example

 /**
  * @param AbstractGeometryType $type
  * @param string               $sqlExpr
  *
  * @return GeometryInterface
  * @throws InvalidValueException
  */
 public function convertBinaryToPHPValue(AbstractGeometryType $type, $sqlExpr)
 {
     if (!is_resource($sqlExpr)) {
         throw new InvalidValueException(sprintf('Invalid resource value "%s"', $sqlExpr));
     }
     $sqlExpr = stream_get_contents($sqlExpr);
     return parent::convertBinaryToPHPValue($type, $sqlExpr);
 }