@param string $name
@param mixed $type The JobTypeInterface or the alias of the job type registered as a service

@return JobBuilder
19612
public function createNamedBuilder($name, $type = 'job', array $initOptions = array(), array $execOptions = array())
    {
        if (is_string($type)) {
            $type = $this->registry->getType($type);
        }

        if ($type instanceof JobTypeInterface) {
            $type = $this->resolveType($type);
        } elseif (!$type instanceof ResolvedJob) {
            throw new \InvalidArgumentException(sprintf('Type "%s" should be a string, JobTypeInterface or ResolvedJob', (is_object($type) ? get_class($type) : $type)));
        }

        return $type->createBuilder($name, $this, $initOptions, $execOptions);
    }
147742
public function createType($name)
    {
        $type = new Type($name);
        $this->manager->persist($type);
        $this->manager->flush();

        return $type;
    }
590124
public function sysLog($name = 'cygnite', $type = 'debug')
    {
        return $this->pushHandler(new SyslogHandler($name, LOG_USER, $type), false);
    }
848376
public function make($type, $name)
    {
        if (!in_array(strtolower($type), $this->type)) {
            echo "{$type} must is {$this->stringSuport}";
            return false;
        }
        $data = $this->bindData($type, $name);
        $file = @fopen($name . '.php', 'w+');

        if ($file) {
            return fwrite($file, $data);
        } else {
            die("permission error!\n");
        }

    }
984566
public function renameType($type, $name)
    {
        $type->setName($name);
        $this->manager->persist($type);
        $this->manager->flush();

        return $type;
    }
1152204
public function resolveType(JobTypeInterface $type)
    {
        $parentType = $type->getParent();

        if ($parentType instanceof JobTypeInterface) {
            $parentType = $this->resolveType($parentType);
        } elseif (null !== $parentType) {
            $parentType = $this->registry->getType($parentType);
        }

        return $this->createResolvedType($type, $parentType);
    }
428332
protected function getOrMake(string $name) : JobInterface
    {
        $value = $this->jobs[$name];

        if ($value instanceof JobInterface) {
            return $value;
        }

        if (is_string($value)) {
            $reflectionClass = new ReflectionClass($value);

            $job = $reflectionClass->newInstance(); // Create instance
        } else {
            /** @var Closure $value */
            $job = $value(); // Execute closure
        }

        if (! $job instanceof JobInterface) {
            throw new JobException("Object '$name' is not a job!");
        }

        $this->jobs[$name] = $job;

        return $job;
    }
1159363
protected static function createNode(string $name, string $type = 'array')
    {
        return Configuration::getRootNodeWithoutDeprecation(new TreeBuilder($name, $type), $name, $type);
    }
794930
public static function setter($name, $type)
  {
    $setter = self::method(
      'set' . ucfirst($name),
      [
        new ParameterGenerator($name, $type)
      ]
    );

    $setter->getDocBlock()->setTag(new GenericTag('return', 'static'));

    $body = "\$this->{$name} = \${$name};" . PHP_EOL
    . "return \$this;" . PHP_EOL;

    $setter->setBody($body);

    return $setter;
  }
920013
public function deleteRole(string $type, string $name): WebAclRule {
        self::checkRoleType($type);
        unset($this->roles[$type][$name]);
        return $this;
    }
1147420
public function createAction($name, $type = null, array $options = [])
    {
        $this->preventIfLocked();

        if (null !== $type) {
            return $this->getFactory()->createActionBuilder($name, $type, $options);
        }

        throw new \InvalidArgumentException('Action type guessing is not yet supported.');
        // TODO return $this->getFormFactory()->createActionBuilderForProperty($this->getDataClass(), $name, $options);
    }
260333
public function restore($type, $name)
    {
        if (!is_string($type) || !isset($this->algos[$type])) {
            throw new \InvalidArgumentException();
        }
        if (isset($this->savedAlgos[$type][$name])) {
            $this->algos[$type][$name] = $this->savedAlgos[$type][$name];
        }
        return $this;
    }
280152
public function createService(ServiceLocatorInterface $serviceLocator, $name = null)
    {
        $config = $serviceLocator->get('Config');

        if (! $config['ocra_service_manager']['logged_service_manager']) {
            return $serviceLocator;
        }

        /* @var $proxyFactory \ProxyManager\Factory\AccessInterceptorScopeLocalizerFactory */
        $proxyFactory = $serviceLocator->get('OcraServiceManager\\ServiceManager\\AccessInterceptorProxyFactory');
        /* @var $locatorInterceptors \Closure[] */
        $locatorInterceptors = $serviceLocator->get('OcraServiceManager\\ServiceManager\\AccessInterceptors');

        // @todo maybe this should be a callback, and `locatorInterceptors` should not be used explicitly
        $proxyLocator = $proxyFactory->createProxy($serviceLocator, array(), $locatorInterceptors);

        if (! ($name && $serviceLocator instanceof ServiceManager)) {
            return $proxyLocator;
        }

        // @todo this service hardcoding should be removed
        $allowOverrides = $serviceLocator->getAllowOverride();

        $serviceLocator->setAllowOverride(true);
        $serviceLocator->setService('ServiceManager', $proxyLocator);
        $serviceLocator->setAllowOverride($allowOverrides);

        return $proxyLocator;
    }
589941
public function get(string $name) : JobInterface
    {
        if ($this->has($name)) {
            return $this->getOrMake($name);
        }

        throw new JobException("There is no such job: '$name'");
    }
1262302
public function export($name, $type)
	{
		$model = Bauhaus::getInstance($name)
			->buildList()
			->buildFilters()
			->buildScopes();

		return $model->getExportBuilder()
			->export($type);
	}
367691
public static function build($name, $type)
	{
		$factory = new BuildFactory(self::config($name), $type);
		$buildNode = $factory->build();
		$buildNode->build();
		return $buildNode->getNodes();
	}
848540
private function instanciateField(string $name, string $type): FieldInterface
    {
        $fieldClass = $this->getFieldClass($type);
        $field = new $fieldClass($name);

        if (!$field instanceof FieldInterface) {
            throw new Exception("Field class \"{$fieldClass}\" must implements ".FieldInterface::class);
        }

        if ($field instanceof TranslatorAwareFieldInterface) {
            $field->setTranslator($this->translator);
        }
        if ($field instanceof TwigAwareFieldInterface) {
            $field->setTwig($this->twig);
        }

        return $field;
    }