Doctrine/DoctrineUtils.php
public static function getIdentifier(ClassMetadata $targetEntity)
    {
        if (!isset(self::$cacheIdentifiers[$targetEntity->getName()])) {
            $identifier = $targetEntity->getIdentifierFieldNames();
            self::$cacheIdentifiers[$targetEntity->getName()] = 0 < \count($identifier)
                ? $identifier[0]
                : 'id';
        }

        return self::$cacheIdentifiers[$targetEntity->getName()];
    }
public static function getIdentifier(ClassMetadata $targetEntity)
    {
        if (!isset(self::$cacheIdentifiers[$targetEntity->getName()])) {
            $identifier = $targetEntity->getIdentifierFieldNames();
            self::$cacheIdentifiers[$targetEntity->getName()] = 0 < \count($identifier)
                ? $identifier[0]
                : 'id';
        }

        return self::$cacheIdentifiers[$targetEntity->getName()];
    }
public static function getIdentifier ( ClassMetadata $ targetEntity ) { if ( ! isset ( self :: $ cacheIdentifiers [ $ targetEntity -> getName ( ) ] ) ) { $ identifier = $ targetEntity -> getIdentifierFieldNames ( ) ; self :: $ cacheIdentifiers [ $ targetEntity -> getName ( ) ] = 0 < \ count ( $ identifier ) ? $ identifier [ 0 ] : 'id' ; } return self :: $ cacheIdentifiers [ $ targetEntity -> getName ( ) ] ; }
Get the identifier of entity.

@param ClassMetadata $targetEntity The target entity

@return string
Get the identifier of entity .