public function getEntityByIdentifier($identifier)
    {
        $found_entities = $this->filter(
            function (EntityInterface $entity) use ($identifier) {
                return $entity->getIdentifier() === $identifier;
            }
        );

        return $found_entities->getFirst();
    }
public function getEntityByIdentifier($identifier)
    {
        $found_entities = $this->filter(
            function (EntityInterface $entity) use ($identifier) {
                return $entity->getIdentifier() === $identifier;
            }
        );

        return $found_entities->getFirst();
    }
public function getEntityByIdentifier ( $ identifier ) { $ found_entities = $ this -> filter ( function ( EntityInterface $ entity ) use ( $ identifier ) { return $ entity -> getIdentifier ( ) === $ identifier ; } ) ; return $ found_entities -> getFirst ( ) ; }
Returns the entity in the list with the specified identifier.

@return EntityInterface
Returns the entity in the list with the specified identifier .