Create Doctrine2MetaDataDAO instance
@return Doctrine2MetaDataDAO
4288
public static function getInstance()
    {
        $fileManager    = new FileManager();
        $serviceManager = ZendFramework2Environnement::getDependence($fileManager);
        $entityManager  = $serviceManager->get('doctrine.entitymanager.orm_default');

        if (($entityManager instanceof EntityManager) === false) {
            throw new \Exception(
                sprintf(
                    'Service manager return instanceof "%s" instead of "%s"',
                    is_object($entityManager) === true ? get_class($entityManager) : gettype($entityManager),
                    'Doctrine\ORM\EntityManager'
                )
            );
        }

        return new Doctrine2MetaDataDAO($entityManager);
    }
371456
public function createInstance()
    {
        switch ($this->method) {
            case 'addBigIntegerColumn':
            case 'addBinaryColumn':
            case 'addBooleanColumn':
            case 'addDateColumn':
            case 'addDateTimeColumn':
            case 'addDecimalColumn':
            case 'addFloatColumn':
            case 'addIntegerColumn':
            case 'addSmallIntegerColumn':
            case 'addStringColumn':
            case 'addTextColumn':
            case 'addTimeColumn':
                $namespace = 'Rentgen\\Database\\Column\\';
                $class = $namespace . ltrim($this->method, 'add');
                $options = isset($this->params[1]) ? $this->params[1] : array();

                if ('addStringColumn' === $this->method && !isset($options['limit'])) {
                    $options['limit'] = 255;
                }
                $column = new $class($this->params[0], $options);
                break;
            case 'addCustomColumn':
                $options = isset($this->params[2]) ? $this->params[2] : [];
                $column = new CustomColumn($this->params[0], $this->params[1], $options);
                break;
            default:
                throw new \Exception(sprintf("Unsupported method " . $this->method));
        }

        if (isset($options['comment'])) {
            $column->setDescription($options['comment']);
        }

        return $column;
    }
983911
public function build()
    {
        $cm = $this->builder->getClassMetadata();
        if ($this->generatedValue) {
            $cm->setIdGeneratorType(constant('Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_' . $this->generatedValue));
        }
        if ($this->version) {
            $cm->setVersionMapping($this->mapping);
        }
        $cm->mapField($this->mapping);
        if ($this->sequenceDef) {
            $cm->setSequenceGeneratorDefinition($this->sequenceDef);
        }
        return $this->builder;
    }
1229717
public function createQuery()
    {
        return $this->getParent()->getMongator()->getRepository($this->getDocumentClass())->createQuery(array(
            '_id' => array('$in' => $this->doInitializeSavedData()),
        ));
    }
1335560
private function createSmf()
    {
        $definition = new Definition(
            Utility::getLibraryClass('Persister\MongoDb\StorageMetadataFactory'),
            [new Reference(Utility::getAliasedName('util.entity'))]
        );
        $definition->setPublic(false);
        return $definition;
    }
282546
public function create()
    {
        if (! $this->exists() && $this->canCreate()) {
            $this->adapter->mkdir($this->path, 0755, true);
        }
        return $this;
    }
411927
protected function createDatabaseDriver()
	{
		$connection = $this->getDatabaseConnection();

		$table = $connection->getTablePrefix().$this->app['config']['session.table'];

		return $this->buildSession(new PdoSessionHandler($connection->getPdo(), $this->getDatabaseOptions($table)));
	}
1229
public function build()
    {
        $annotationReader = $this->annotationReader;
        if (null === $annotationReader) {
            $annotationReader = new AnnotationReader();

            if (null !== $this->cacheDir) {
                $this->createDir($this->cacheDir . '/annotations');
                $annotationReader = new FileCacheReader($annotationReader, $this->cacheDir . '/annotations', $this->debug);
            }
        }

        $metadataDriver = $this->driverFactory->createDriver($this->metadataDirs, $annotationReader);
        $metadataFactory = new MetadataFactory($metadataDriver);

        $metadataFactory->setIncludeInterfaces($this->includeInterfaceMetadata);

        if (null !== $this->cacheDir) {
            $this->createDir($this->cacheDir . '/metadata');
            $metadataFactory->setCache(new FileCache($this->cacheDir . '/metadata'));
        }

        $schemaRegistry = new SchemaRegistry($this->schemaDirs);

        // TODO registry caching

        return new Manager($metadataFactory, $schemaRegistry);
    }
1321296
public function createMetaEntityFactory(): MetaEntityFactory {
		if (!(isset($this->metaEntityFactory))) {
			$this->metaEntityFactory = new OracleMetaEntityFactory($this);
		}
		return $this->metaEntityFactory;
	}
19550
public function create()
    {
        /**
         * @var BannerZoneInterface $bannerZone
         */
        $classNamespace = $this->getEntityNamespace();
        $bannerZone = new $classNamespace();
        $bannerZone->setBanners(new ArrayCollection());

        return $bannerZone;
    }
494687
public function create()
    {
        $pdo = null;
        try {
            $pdo = $this->connect();
        } catch (\Exception $e) {
            $pdo = null;
            if ($this->isLostConnection($e)) {
                $pdo = $this->reconnect();
            }

            throw new \LogicException('Connection lost and no reconnector available.');
        }

        return $pdo;
    }
863654
public function create()
    {
        /**
         * @var Comment $comment
         */
        $classNamespace = $this->getEntityNamespace();
        $comment = new $classNamespace();
        $comment
            ->setParent(null)
            ->setChildren(new ArrayCollection())
            ->setEnabled(true)
            ->setCreatedAt($this->now());

        return $comment;
    }
1007067
public function create()
    {
        $instance = self::createOption($this);
        $this->setId($instance->getId());
        return $instance;
    }
554086
public function create()
    {
        $instance = self::createStoreCredit($this);
        $this->setId($instance->getId());
        return $instance;
    }
1183528
public function build()
    {
        $callback = $this->callback;

        // We will create a new class metadata builder instance,
        // so we can use it to easily generated a new mapping
        // array, without re-declaring the existing field
        $builder = $this->newClassMetadataBuilder();

        $source = $this->convertToMappingArray($this->builder);

        // Create a new field builder for the new class metadata builder,
        // based on the existing (to be overridden) field
        $fieldBuilder = $this->getFieldBuilder(
            $builder,
            $source
        );

        $field = $callback($fieldBuilder);

        // When the user forget to return, use the Field instance
        // which contains the same information
        $field = $field ?: $fieldBuilder;

        if (!$field instanceof Field) {
            throw new InvalidArgumentException('The callback should return an instance of '.Field::class);
        }

        $field->build();

        $target = $this->convertToMappingArray($builder);

        $this->builder->getClassMetadata()->setAttributeOverride(
            $this->name,
            $this->mergeRecursively($source, $target)
        );
    }
645219
public function create()
    {
        /**
         * @var Category $category
         */
        $classNamespace = $this->getEntityNamespace();
        $category = new $classNamespace();
        $category
            ->setSubcategories(new ArrayCollection())
            ->setRoot(true)
            ->setPosition(0)
            ->setEnabled(true)
            ->setCreatedAt($this->now());

        return $category;
    }
1091436
public function create()
    {
        /**
         * @var Location $location
         */
        $classNamespace = $this->getEntityNamespace();
        $location = new $classNamespace();
        $location
            ->setChildren(new ArrayCollection())
            ->setParents(new ArrayCollection());

        return $location;
    }