bridge/doctrine-collections/lib/CollectionsAgent.php
public function getIdentifier($object)
    {
        foreach ($this->store->getCollection(get_class($object)) as $identifier => $element) {
            if ($element === $object) {
                return $identifier;
            }
        }

        throw new \RuntimeException(sprintf(
            'Could not find identifier for object of class "%s"',
            get_class($object)
        ));
    }
public function getIdentifier($object)
    {
        foreach ($this->store->getCollection(get_class($object)) as $identifier => $element) {
            if ($element === $object) {
                return $identifier;
            }
        }

        throw new \RuntimeException(sprintf(
            'Could not find identifier for object of class "%s"',
            get_class($object)
        ));
    }
{@inheritdoc}