public function get($entity)
    {
        foreach ($this->services as $interface => $generator) {
            if ($entity instanceof $interface) {
                return $generator;
            }
        }

        throw new NonExistingServiceException(get_class($entity));
    }
public function get($entity)
    {
        foreach ($this->services as $interface => $generator) {
            if ($entity instanceof $interface) {
                return $generator;
            }
        }

        throw new NonExistingServiceException(get_class($entity));
    }
public function get ( $ entity ) { foreach ( $ this -> services as $ interface => $ generator ) { if ( $ entity instanceof $ interface ) { return $ generator ; } } throw new NonExistingServiceException ( get_class ( $ entity ) ) ; }
Return the generator used for the given entity

@param object $entity

@return GeneratorInterface

@throws NonExistingServiceException
Return the generator used for the given entity