public function getContainer()
    {
        if (property_exists(__CLASS__, 'container')) {
            return $this->container;
        } else {
            return parent::getContainer();
        }

        throw new RuntimeException(sprintf('The service container must be accessible from class %s to use this trait', __CLASS__));
    }
public function getContainer()
    {
        if (property_exists(__CLASS__, 'container')) {
            return $this->container;
        } else {
            return parent::getContainer();
        }

        throw new RuntimeException(sprintf('The service container must be accessible from class %s to use this trait', __CLASS__));
    }
public function getContainer ( ) { if ( property_exists ( __CLASS__ , 'container' ) ) { return $ this -> container ; } else { return parent :: getContainer ( ) ; } throw new RuntimeException ( sprintf ( 'The service container must be accessible from class %s to use this trait' , __CLASS__ ) ) ; }
Get the Service Container.

@return \Symfony\Component\DependencyInjection\ContainerInterface

@throws RuntimeException If the service container is not accessible
Get the Service Container .