public function quote($value, $type = null): string
    {
        if (null === $value) {
            return 'NULL';
        }

        $resource = $this->getResource(); // forces connecting if not connected yet
        if (null !== $type) {
            return "'" . pg_escape_string($resource, $this->getTypeConverter($type)->output($value)) . "'";
        } else {
            return "'" . pg_escape_string(
                $resource,
                $this->getTypeConverterFactory()
                    ->getConverterForPHPValue($value)
                    ->output($value)
            ) . "'";
        }
    }
public function quote($value, $type = null): string
    {
        if (null === $value) {
            return 'NULL';
        }

        $resource = $this->getResource(); // forces connecting if not connected yet
        if (null !== $type) {
            return "'" . pg_escape_string($resource, $this->getTypeConverter($type)->output($value)) . "'";
        } else {
            return "'" . pg_escape_string(
                $resource,
                $this->getTypeConverterFactory()
                    ->getConverterForPHPValue($value)
                    ->output($value)
            ) . "'";
        }
    }
public function quote ( $ value , $ type = null ) : string { if ( null === $ value ) { return 'NULL' ; } $ resource = $ this -> getResource ( ) ; // forces connecting if not connected yet if ( null !== $ type ) { return "'" . pg_escape_string ( $ resource , $ this -> getTypeConverter ( $ type ) -> output ( $ value ) ) . "'" ; } else { return "'" . pg_escape_string ( $ resource , $ this -> getTypeConverterFactory ( ) -> getConverterForPHPValue ( $ value ) -> output ( $ value ) ) . "'" ; } }
Quotes a value for inclusion in query, taking connection encoding into account

@param mixed $value
@param mixed $type
@return string
@throws exceptions\TypeConversionException
Quotes a value for inclusion in query taking connection encoding into account