Creates an EntityBuilder

@param   string $dataDirectory The data directory

@return  EntityBuilder
498062
private function createEntityBuilder($dataDirectory)
    {
        $strategy = new RecursiveDirectoryStrategy($dataDirectory);
        $locator  = new Locator([$strategy]);
        $builder  = new EntityBuilder($locator, $this);

        return $builder;
    }
118452
public function create(CreateStruct $createStruct, array $parentNode)
    {
        try {
            return $this->innerGateway->create($createStruct, $parentNode);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
603963
protected function createEntityFromContent(string $content): EntityInterface
    {
        $result = $this->createEntity();
        $result->readData(new DataContainer($this->decodeContent($content)));
        return $result;
    }
454097
public function create($itemData, $rewriteIfExist = false)
    {
        $newData = $this->preCreate($itemData, $rewriteIfExist);
        $result = $this->dataStore->create($newData, $rewriteIfExist);

        return $this->postCreate($result, $newData, $rewriteIfExist);
    }
1096830
public function createJobQueryBuilder($alias)
    {
        return $this->getEntityManager()
            ->createQueryBuilder()
            ->select($alias)
            ->from($this->entityClass, $alias);
    }
36137
public static function createEntities($entityClass, $dataArray)
    {
        return array_map(function ($data) use ($entityClass) {
            return static::createEntity($entityClass, $data);
        }, $dataArray);
    }
1174615
public function buildCountriesCoollection($dataDir)
    {
        $this->helper->message('Processing countries...');

        $mledoze = $this->mledoze->loadMledozeCountries();

        $shapeFile = $this->helper->loadShapeFile('third-party/natural_earth/ne_10m_admin_0_countries');

        $this->helper->message('Generating countries...');

        $countries = coollect($shapeFile)->map(function ($country) {
            return $this->natural->fixNaturalOddCountries($country);
        })->mapWithKeys(function ($natural) use ($mledoze, $dataDir) {
            list($mledoze, $countryCode) = $this->mledoze->findMledozeCountry($mledoze, $natural);

            $natural = coollect($natural)->mapWithKeys(function ($country, $key) {
                return [strtolower($key) => $country];
            });

            if (is_null($countryCode)) {
                $result = $this->mledoze->fillMledozeFields($natural);

                $countryCode = $natural['adm0_a3'];
            } else {
                $result = $this->mledoze->mergeWithMledoze($mledoze, $natural);
            }

            $result = $this->rinvex->mergeWithRinvex(
                $result,
                $this->rinvex->findRinvexCountry($result),
                $this->rinvex->findRinvexTranslations($result)
            );

            $result = $this->clearCountryCurrencies($result);

            $result = $this->updater->addDataSource($result, 'natural');

            $result = $this->updater->addRecordType($result, 'country');

            $result = $result->sortByKeysRecursive();

            $this->helper->putFile(
                $this->helper->makeJsonFileName(strtolower($countryCode), $dataDir),
                $result->toJson(JSON_PRETTY_PRINT)
            );

            $this->helper->message($result['name']['common']);

            return [$countryCode => $result];
        });

        return $mledoze->overwrite($countries);
    }
86137
public function create(array $data = null, $persist=false)
    {
        $entity = parent::create($data);
        
        $eventArgs = new LifecycleEventArgs($entity, $this->dm);
        $this->dm->getEventManager()->dispatchEvent(
            Events::postLoad,
            $eventArgs
        );
        return $entity;
    }
444126
public function createEntity(array $data = [], EntityInterface $parent_entity = null, $apply_default_values = false)
    {
        return parent::createEntity($data, $parent_entity, true);
    }
971737
public static function create($data = [], Entity $entity = null)
    {
        $record = new static($data, $entity);

        $record->save();

        return $record;
    }
1332415
public function createValueBuilder() {
		if (null !== ($entityModel = $this->determineEntityModel())) {
			return new EagerValueBuilder($entityModel->getClass());
		}

		return new EagerValueBuilder(null);
	}
683033
private function createQueryBuilder(string $entityNamespace) : QueryBuilder
    {
        return $this
            ->doctrine
            ->getManagerForClass($entityNamespace)
            ->createQueryBuilder()
            ->select(['x'])
            ->from($entityNamespace, 'x');
    }
499063
protected function buildDirectory(DirectoryPath $root, SplFileInfo $splDirectory = null)
    {
        $relativeDirectoryPath = '';
        if (null !== $splDirectory) {
            $relativeDirectoryPath = $splDirectory->getRelativePathName();
        }

        $directory = new Directory(
            $this->getBasePath()->toAbsoluteFileSystemString(),
            $root->toRelativeFileSystemString(),
            $relativeDirectoryPath . DIRECTORY_SEPARATOR
        );

        return $directory;
    }
1236461
public static function buildDic(StringType $definitionFile)
    {
        if (!file_exists($definitionFile())) {
            throw new \Exception(self::ERR_NO_DIC);
        }

        //create dic
        /** @noinspection PhpUndefinedMethodInspection */
        return FFor::create(['definitionFile' => $definitionFile])
            //create the DIC
            ->dic(function () {
                return PHP_MAJOR_VERSION < 7 ? new ServiceContainer() : new ContainerBuilder();
            })
            //do some processing on the DIC
            ->process(function ($dic, $definitionFile) {
                $fileLocator = new FileLocator(dirname($definitionFile()));
                $fileLoaders = [
                    new XmlFileLoader($dic, $fileLocator),
                    new YamlFileLoader($dic, $fileLocator),
                ];
                (new DelegatingLoader(new LoaderResolver($fileLoaders)))->load($definitionFile());
                self::preCompile($dic);
                /** @noinspection PhpUndefinedMethodInspection */
                $dic->compile();
                self::postCompile($dic);
            })
            //return the completed DIC
            ->fyield('dic');
    }
140906
public function createQueryBuilder($alias, $indexBy = null)
    {
        return $this->em->createQueryBuilder()
            ->select($alias)
            ->from($this->entityName, $alias, $indexBy);
    }
1229046
public static function getFrameworkInstance($rootDirectory)
    {
        if (self::$instance === null) {
            self::$instance = new Framework($rootDirectory);
            self::$instance->initializeFramework();
        }
        
        return self::$instance;
    }
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;
    }