Create mapper source.

@param string|SourceTypeInterface $type
@param SourceDataFactoryInterface $dataFactory
@param string $name

@return Source
162674
public function create($type, SourceDataFactoryInterface $dataFactory, $name)
    {
        if (is_string($type)) {
            $type = $this->typeRegistry->getType($type);
        }

        return new Source($type, $dataFactory, $name);
    }
842026
public static function create($type, ClassMetadataBuilder $builder)
    {
        if (isset(static::$map[$type])) {
            return new static::$map[$type]($builder);
        }

        throw new InvalidArgumentException("Inheritance type [{$type}] does not exist. SINGLE_TABLE and JOINED are support");
    }
93273
private function createArgumentDescriptorForMagicMethod(string $name, Type $type): ArgumentDescriptor
    {
        $argumentDescriptor = new ArgumentDescriptor();
        $argumentDescriptor->setType(AssemblerAbstract::deduplicateTypes($type));
        $argumentDescriptor->setName($name);

        return $argumentDescriptor;
    }
828429
public function create($type)
    {
        $typeOptions    = $this->getOption(self::OPTION_MAPPERS);
        $typeOption     = isset($typeOptions[$type]) ? $typeOptions[$type] : $this->throwException();
        $importerString = isset($typeOption[self::OPTION_MAPPERS_IMPORTER]) ? $typeOption[self::OPTION_MAPPERS_IMPORTER] : $this->throwException();
        $importer       = $this->buildService($importerString, ImportServiceInterface::class);

        if (isset($typeOption[self::OPTION_MAPPERS_MAPPER])) {
            $mapperString = $typeOption[self::OPTION_MAPPERS_MAPPER];
            $mapper       = $this->buildService($mapperString);
        } else {
            $mapper = $this->getDefaultMapper();
        }

        $this->propagate($mapper);
        $importer->setMapper($mapper);

        return $importer;
    }
691261
public static function createFromArray($name, array $data = [])
    {
        $type = parent::createFromArray($name, $data);
        \assert($type instanceof self);

        $type->json = $data;

        return $type;
    }
1264235
public DataSource createDataSourceProxy(String name, final DataSource dataSource) {
		assert dataSource != null;
		JdbcWrapperHelper.pullDataSourceProperties(name, dataSource);
		final InvocationHandler invocationHandler = new AbstractInvocationHandler<DataSource>(
				dataSource) {
			private static final long serialVersionUID = 1L;

			/** {@inheritDoc} */
			@Override
			public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
				Object result = method.invoke(dataSource, args);
				if (result instanceof Connection) {
					result = createConnectionProxy((Connection) result);
				}
				return result;
			}
		};
		return createProxy(dataSource, invocationHandler);
	}
1265831
protected function createFormBuilder($type = FormType::class, $data = null, array $options = [])
    {
        return $this->app['form.factory']->createBuilder($type, $data, $options);
    }
178841
public function make($dataClass = null, $options = [], $builder = FormBuilder::class): FormBuilderInterface
    {
        $dataMapperManager = new DataMapperManager(PropertyAccess::createPropertyAccessor());

        $form = new Form(
            $dataClass,
            new FieldsRepository(),
            $this->validation,
            $this->viewer,
            $dataMapperManager
        );
        $form->setManager($this->manager);
        $form->setResourceTransformerFactory($this->factory);
        $form->setAttributes($this->attributes);
        $form->setOptions($options);

        $this->builder = new $builder($form, $dataMapperManager, $dataClass);

        return $this->builder;
    }
1284298
private function sourceDeclaration(string $name, string $type, string $model): SourceDeclaration
    {
        return new SourceDeclaration(
            $this->getConfig()->className('source', $name),
            $type,
            $model
        );
    }
1224067
public function setDatasources(DatasourceFactory $factory, array $datasources) {
        $this->datasourceFactory = $factory;
        $this->datasources = $datasources;
    }
169836
public function add_data_source( \Serializable $source, $name = '' ) {

		if ( $name ) {
			$this->data_sources[ $name ] = $source;
		} else {
			$this->data_sources[] = $source;
		}

		$this->regenerate();

		return $this;
	}
187888
public static function factory($type)
    {
        if ($type instanceof TypeInterface) return $type;

        if (strpos($type, "\\") === false) {
            $type = ucfirst(trim(strval($type)));
            if (strripos(strrev($type), strrev('type')) === false) $type .= 'Type';

            $type = "DataEntity\\Type\\" . $type;
        }

        if (
            !class_exists($type)
            || !in_array("DataEntity\\TypeInterface", class_implements($type))
        ) throw new \InvalidArgumentException('Type ' . $type . ' is invalid.');

        return new $type;
    }
778457
public static Map<String, DataSource> getDataSourceMap(final Map<String, DataSourceConfiguration> dataSourceConfigurationMap) {
        Map<String, DataSource> result = new LinkedHashMap<>(dataSourceConfigurationMap.size(), 1);
        for (Entry<String, DataSourceConfiguration> entry : dataSourceConfigurationMap.entrySet()) {
            result.put(entry.getKey(), entry.getValue().createDataSource());
        }
        return result;
    }
1071270
public function createFilter($name, $type = null, array $options = [])
    {
        $this->preventIfLocked();

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

        throw new \InvalidArgumentException('Filter type guessing is not yet supported.');
        // TODO return $this->getFormFactory()->createFilterBuilderForProperty($this->getDataClass(), $name, $options);
    }
99625
public function source($name = '') : SourceRepository
    {
        $name = $name ?: $this->getDefaultSourceRepository();

        return $this->sources[$name] = $this->get($name);
    }
117656
private static function getBuilder($name, $type)
    {
        static $builders = [];
        if (isset($builders[$type][$name])) {
            return $builders[$type][$name];
        }

        $builderClassMap = self::$builderClassMap[$type];

        if (isset($builderClassMap[$name])) {
            return $builders[$type][$name] = new $builderClassMap[$name]();
        }
        // deprecated relay builder name ?
        $newName = 'Relay::'.\rtrim($name, 'Args');
        if (isset($builderClassMap[$newName])) {
            @\trigger_error(
                \sprintf('The "%s" %s builder is deprecated as of 0.7 and will be removed in 0.12. Use "%s" instead.', $name, $type, $newName),
                \E_USER_DEPRECATED
            );

            return $builders[$type][$newName] = new $builderClassMap[$newName]();
        }

        throw new InvalidConfigurationException(\sprintf('%s builder "%s" not found.', \ucfirst($type), $name));
    }
597186
private function generateGetter(string $name, string $type): EntityGenerator
    {
        if ('datetime' === $type) {
            $type = '\DateTime';
        }

        $this->entityClass
            ->addMethod('get' . ucfirst($name))
            ->setVisibility('public')
            ->addComment('Returns ' . strtolower($this->entityData['class']) . ' ' . $name . PHP_EOL)
            ->addComment('@return ' . $type)
            ->setReturnType($type)
            ->addBody('return $this->' . $name . ';');

        return $this;
    }