Doctrine/DoctrineUtils.php
public static function castIdentifier(ClassMetadata $targetEntity, Connection $connection)
    {
        if (!isset(self::$cacheCastIdentifiers[$targetEntity->getName()])) {
            $cast = '';

            if ($connection->getDriver() instanceof PgSqlDriver) {
                $type = self::getIdentifierType($targetEntity);
                $cast = '::'.$type->getSQLDeclaration(
                    $targetEntity->getIdentifierFieldNames(),
                    $connection->getDatabasePlatform()
                );
            }

            self::$cacheCastIdentifiers[$targetEntity->getName()] = $cast;
        }

        return self::$cacheCastIdentifiers[$targetEntity->getName()];
    }
public static function castIdentifier(ClassMetadata $targetEntity, Connection $connection)
    {
        if (!isset(self::$cacheCastIdentifiers[$targetEntity->getName()])) {
            $cast = '';

            if ($connection->getDriver() instanceof PgSqlDriver) {
                $type = self::getIdentifierType($targetEntity);
                $cast = '::'.$type->getSQLDeclaration(
                    $targetEntity->getIdentifierFieldNames(),
                    $connection->getDatabasePlatform()
                );
            }

            self::$cacheCastIdentifiers[$targetEntity->getName()] = $cast;
        }

        return self::$cacheCastIdentifiers[$targetEntity->getName()];
    }
public static function castIdentifier ( ClassMetadata $ targetEntity , Connection $ connection ) { if ( ! isset ( self :: $ cacheCastIdentifiers [ $ targetEntity -> getName ( ) ] ) ) { $ cast = '' ; if ( $ connection -> getDriver ( ) instanceof PgSqlDriver ) { $ type = self :: getIdentifierType ( $ targetEntity ) ; $ cast = '::' . $ type -> getSQLDeclaration ( $ targetEntity -> getIdentifierFieldNames ( ) , $ connection -> getDatabasePlatform ( ) ) ; } self :: $ cacheCastIdentifiers [ $ targetEntity -> getName ( ) ] = $ cast ; } return self :: $ cacheCastIdentifiers [ $ targetEntity -> getName ( ) ] ; }
Cast the identifier.

@param ClassMetadata $targetEntity The target entity
@param Connection    $connection   The doctrine connection

@return string
Cast the identifier .