Set factory mode

@param  bool $factory
@return DefinitionInterface
542641
public function setFactoryMode($factory = true) {
		$this->factoryMode = (bool) $factory;
		
		if ($this->factoryMode) {
			$this->reset();
		}
		
		return $this;
	}
1000005
public function resolveClassString(string $class, $factory = false)
    {
        if($factory === true) {
            return $this->resolveClass($class);
        }

        return $this->resolveClassFromCache($class);
    }
77132
public function add(FactoryInterface $factory, $before = null)
    {
        $pos = null;

        if ($before) {
            foreach ($this->factories as $i => $f) {
                if ($before instanceof FactoryInterface) {
                    if ($f === $before) {
                        $pos = $i;
                        break;
                    }
                } elseif (is_string($before)) {
                    if ($f instanceof $before) {
                        $pos = $i;
                        break;
                    }
                }
            }
        }

        if ($pos === null) {
            $this->factories[] = $factory;
        } else {
            array_splice($this->factories, $i, 0, array($factory));
        }

        return $this;
    }
410785
public static function create($definition)
    {
        if ($definition instanceof FabricateDefinition) {
            return new FabricateDefinitionFactory($definition);
        }
        if ($definition instanceof FabricateModel) {
            return new FabricateModelFactory($definition);
        }
        throw new \InvalidArgumentException("FabricateFactory is not support instance");
    }
393000
protected function registerPathMappings($factory)
    {
        $assetPath = $this->app->__invoke(PathFinder::class)->to('assets');

        $factory->map('css', $assetPath->absolute('css'), $assetPath->url('css'));
        $factory->map('js', $assetPath->absolute('js'), $assetPath->url('js'));
    }
815492
public function register(callable $factory, $priority = 0): self
    {
        array_unshift($this->engines, [$factory, $priority]);
        $this->cache = null;

        $sorted = false;
        while (!$sorted) {
            $sorted = true;
            for ($i = 0, $l = count($this->engines) - 1; $i < $l; $i++) {
                if ($this->engines[$i][1] < $this->engines[$i + 1][1]) {
                    $tmp = $this->engines[$i];
                    $this->engines[$i] = $this->engines[$i + 1];
                    $this->engines[$i + 1] = $tmp;
                    $sorted = false;
                }
            }
        }

        return $this;
    }
177259
final public static function register(Factory $factory) {
        if(!isset(self::$factories[$factory->driver]))
            self::$factories[$factory->driver] = $factory;
    }
692607
public function init($force = false)
    {
        $flockFactory = new Factory(new FlockStore());

        $lock = $flockFactory->createLock('propel-cache-generation');

        // Acquire a blocking cache generation lock
        $lock->acquire(true);

        try {
            if ($force) {
                (new Filesystem())->remove($this->getPropelCacheDir());
            }

            if (!file_exists($this->getTheliaDatabaseConfigFile())) {
                return false;
            }

            $this->buildPropelConfig();

            $this->buildPropelInitFile();
            require $this->getPropelInitFile();

            $theliaDatabaseConnection = Propel::getConnection('thelia');
            $this->schemaLocator->setTheliaDatabaseConnection($theliaDatabaseConnection);

            $this->buildPropelGlobalSchema();

            $this->buildPropelModels();
            $this->registerPropelModelLoader();

            $theliaDatabaseConnection->setAttribute(ConnectionWrapper::PROPEL_ATTR_CACHE_PREPARES, true);

            if ($this->debug) {
                // In debug mode, we have to initialize Tlog at this point, as this class uses Propel
                Tlog::getInstance()->setLevel(Tlog::DEBUG);

                Propel::getServiceContainer()->setLogger('defaultLogger', Tlog::getInstance());
                $theliaDatabaseConnection->useDebug(true);
            }
        } catch (\Throwable $th) {
            $fs = new Filesystem();
            $fs->remove(THELIA_CACHE_DIR . $this->environment);
            $fs->remove($this->getPropelModelDir());
            throw $th;
        } finally {
            // Release cache generation lock
            $lock->release();
        }

        return true;
    }
217616
public function setFactory(string $factory): Service
    {
        $factoryExploded = explode('::', $factory, 2);

        if (!class_exists($factoryExploded[0]) || !method_exists($factoryExploded[0], $factoryExploded[1])) {
            throw new ContainerException(sprintf('Must be a valid factory class and static method, "%s" given', $factory));
        }

        $this->factory = $factory;

        return $this;
    }
1156094
public function build($factory, $parameters) {
		$type = $this->getType($factory);

		list($reflector, $dependencies) = $this->generateReflector($type, $factory);

		$requires = $this->dispatchRequirements($dependencies, $parameters);

		if (is_callable($reflector)) {
			return call_user_func_array($reflector, $requires);
		}

		return $reflector->newInstanceArgs($requires);
	}
199825
public function setFactory($factory)
    {
        $this->changes['factory'] = true;

        if (\is_string($factory) && false !== strpos($factory, '::')) {
            $factory = explode('::', $factory, 2);
        } elseif ($factory instanceof Reference) {
            $factory = [$factory, '__invoke'];
        }

        $this->factory = $factory;

        return $this;
    }
344277
public function addFactory(FilterBagFactoryInterface $factory, $priority = 0)
    {
        $this->factories[$priority][] = $factory;

        unset($this->sorted);
    }
792122
public function structureOnFolderEdit(FactoryInterface $factory, array $options)
    {
        $menu = $this->structure($factory, $options);

        $item = $menu->addChild('Folder edit', ['uri' => '#']);
        $item->setCurrent(true);

        return $menu;
    }
724975
protected function createDefaultValidator(Factory $factory)
    {
        return $factory->make(
            $this->validationData(), $this->app()->call([$this, 'rules']),
            $this->messages(), $this->attributes()
        );
    }
42726
public function validator($factory)
    {
        if (method_exists($this, 'sanitize')) {
            $this->merge($this->container->call([$this, 'sanitize']));
        }

        return $factory->make(
            $this->validationData(), $this->container->call([$this, 'rules']),
            $this->messages(), $this->attributes()
        );
    }
681018
static function factory()
    {
        if ( self::$factory === false )
        {
            self::$factory = true;
            self::instance()->readINISettings();
            eZImageAnalyzer::readAnalyzerSettingsFromINI();
        }
        return self::instance();
    }
570979
protected function getFactory($class) {
		if (isset($this->factories[$class])) {
			return $this->factories[$class];
		}

		$factory = new $class($this);
		$this->factories[$class] = $factory;
		return $factory;
	}