src/Form/ChoiceList/ModelChoiceList.php
public function getIdentifierValues($entity)
    {
        try {
            return $this->modelManager->getIdentifierValues($entity);
        } catch (\Exception $e) {
            throw new InvalidArgumentException(sprintf('Unable to retrieve the identifier values for entity %s', ClassUtils::getClass($entity)), 0, $e);
        }
    }
public function getIdentifierValues($entity)
    {
        try {
            return $this->modelManager->getIdentifierValues($entity);
        } catch (\Exception $e) {
            throw new InvalidArgumentException(sprintf('Unable to retrieve the identifier values for entity %s', ClassUtils::getClass($entity)), 0, $e);
        }
    }
public function getIdentifierValues ( $ entity ) { try { return $ this -> modelManager -> getIdentifierValues ( $ entity ) ; } catch ( \ Exception $ e ) { throw new InvalidArgumentException ( sprintf ( 'Unable to retrieve the identifier values for entity %s' , ClassUtils :: getClass ( $ entity ) ) , 0 , $ e ) ; } }
Returns the values of the identifier fields of an entity.

Doctrine must know about this entity, that is, the entity must already
be persisted or added to the identity map before. Otherwise an
exception is thrown.

@param object $entity The entity for which to get the identifier

@throws InvalidArgumentException If the entity does not exist in Doctrine's
identity map

@return array
Returns the values of the identifier fields of an entity .