Provider/EntityProvider.php
public function evaluateEntityInstanceFactory(array $factory)
    {
        if (!isset($factory['class'])) {
            throw new InvalidArgumentException();
        }

        $factoryReference = $factory['class'];

        $factoryMethod = isset($factory['method'])
            ? $factory['method']
            : $this->defaultFactoryMethod;

        $factoryStatic = isset($factory['static'])
            ? (bool) $factory['static']
            : (bool) $this->defaultFactoryStatic;

        $factory = class_exists($factoryReference)
            ? (
            $factoryStatic
                ? $factoryReference
                : new $factoryReference()
            )
            : $this
                ->container
                ->get($factoryReference);

        return $factoryStatic
            ? $factory::$factoryMethod()
            : $factory->$factoryMethod();
    }
public function evaluateEntityInstanceFactory(array $factory)
    {
        if (!isset($factory['class'])) {
            throw new InvalidArgumentException();
        }

        $factoryReference = $factory['class'];

        $factoryMethod = isset($factory['method'])
            ? $factory['method']
            : $this->defaultFactoryMethod;

        $factoryStatic = isset($factory['static'])
            ? (bool) $factory['static']
            : (bool) $this->defaultFactoryStatic;

        $factory = class_exists($factoryReference)
            ? (
            $factoryStatic
                ? $factoryReference
                : new $factoryReference()
            )
            : $this
                ->container
                ->get($factoryReference);

        return $factoryStatic
            ? $factory::$factoryMethod()
            : $factory->$factoryMethod();
    }
public function evaluateEntityInstanceFactory ( array $ factory ) { if ( ! isset ( $ factory [ 'class' ] ) ) { throw new InvalidArgumentException ( ) ; } $ factoryReference = $ factory [ 'class' ] ; $ factoryMethod = isset ( $ factory [ 'method' ] ) ? $ factory [ 'method' ] : $ this -> defaultFactoryMethod ; $ factoryStatic = isset ( $ factory [ 'static' ] ) ? ( bool ) $ factory [ 'static' ] : ( bool ) $ this -> defaultFactoryStatic ; $ factory = class_exists ( $ factoryReference ) ? ( $ factoryStatic ? $ factoryReference : new $ factoryReference ( ) ) : $ this -> container -> get ( $ factoryReference ) ; return $ factoryStatic ? $ factory :: $ factoryMethod ( ) : $ factory -> $ factoryMethod ( ) ; }
Evaluates entity instance using a factory.

@param array $factory

@return object Entity instance

@throws InvalidArgumentException          if the service is not defined
@throws ServiceCircularReferenceException When a circular reference is detected
@throws ServiceNotFoundException          When the service is not found
Evaluates entity instance using a factory .