Register an Entity definition.  Note this method DOES NOT generate the classes.  They are generated when needed.

@param  EntityDefinition  $builder

@return  void
557837
public function register(EntityDefinition $builder): void {
    $this->defs[$builder->full_name] = $builder;
    $this->unchecked[] = $builder;

    $binding_name = str_replace('\\', '.', $builder->full_name);
    $this->ioc->bind('bap.remodel.scopes.' . $binding_name, function() use($builder) {
      return $builder->scopes;
    });

    foreach($builder->virtuals as $virtual) {
      $this->ioc->bind("bap.remodel.virtuals.{$binding_name}.{$virtual->alias}", function() use($virtual) {
        return $virtual->callback;
      });
    }

    $this->tailor->bindCallback($builder->full_name, function(Generator $gen) use($builder): void {
      $this->checkDefinitions();

      $file = $gen->generate('Entity', $builder->toArray());
      $gen->includeFile($file);
    });

    foreach(static::CLASS_SUFFIXES as $class) {
      $this->tailor->bindCallback($builder->full_name . $class, function(Generator $gen) use($builder, $class): void {
        $this->checkDefinitions();

        $file = $gen->generate($class, $builder->toArray());
        $gen->includeFile($file);
      });
    }
  }
1029599
protected function defineEntity(ClassDefinition $class)
    {
        $class->property($this->article)->asObject(BlogArticle::class);

        $class->property($this->authorName)->asString();

        $class->property($this->authorEmail)->asObject(EmailAddress::class);

        $class->property($this->content)->asString();

        $class->property($this->postedAt)->asObject(DateTime::class);

        $this->defineMetadata($class);
    }
972692
public static function metaForTemplateEntity(
        ClassMetadataBuilder $builder
    ): void {
        $builder->addManyToOne(
            TemplateEntity::getDoctrineStaticMeta()->getSingular(),
            TemplateEntity::class
        );
    }
1289328
protected function addWithNotVerified(Builder $builder): void
    {
        $builder->macro('withNotVerified', function (Builder $builder) {
            return $builder->withoutGlobalScope($this);
        });
    }
1268616
public static function metaForTemplateEntity(
        ClassMetadataBuilder $builder
    ): void {
        $builder->addOwningOneToOne(
            TemplateEntity::getDoctrineStaticMeta()->getSingular(),
            TemplateEntity::class,
            self::getDoctrineStaticMeta()->getSingular()
        );
    }
780216
public function registerGlobalScopes($builder)
    {
        foreach ($this->getGlobalScopes() as $identifier => $scope) {
            $builder->withGlobalScope($identifier, $scope);
        }

        return $builder;
    }
1354360
function _gpfDefineEntitiesAdd (entityDefinition) {
    _gpfAssert(entityDefinition._instanceBuilder !== null, "Instance builder must be set");
    _gpfAssert(!_gpfDefineEntitiesFindByConstructor(entityDefinition.getInstanceBuilder()), "Already added");
    _gpfDefinedEntities.push(entityDefinition);
}
963924
public function defineFormBuilder(FormBuilderInterface $formBuilder)
    {
        /** @var AbstractAdmin $admin */
        $admin = $this;

        $mapper = new \Compo\Sonata\AdminBundle\Form\FormMapper($admin->getFormContractor(), $formBuilder, $admin);

        $this->configureFormFields($mapper);

        foreach ($admin->getExtensions() as $extension) {
            $extension->configureFormFields($mapper);
        }

        $this->attachInlineValidator();
    }
1364594
private function disableUntranslatableForms(FormBuilderInterface $builder): void
    {
        foreach ($builder as $form) {
            /** @var \Symfony\Component\Form\FormBuilderInterface $form */
            $innerType = $form->getType()->getInnerType();
            $disabled = !$innerType instanceof ParametersType;

            $parameterDefinition = $form->getOption('ngbm_parameter_definition');
            if ($parameterDefinition instanceof ParameterDefinition) {
                $disabled = $parameterDefinition->getOption('translatable') !== true;
            }

            $form->setDisabled($disabled);

            if ($parameterDefinition instanceof ParameterDefinition) {
                continue;
            }

            $this->disableUntranslatableForms($form);
        }
    }
18476
public function apply(Builder $builder, Model $model)
    {
        if ($model->getTypeKey())
        {
            $builder->where(
                $model->getTypeKeyName(),
                $model->getTypeKey()
            );
        }
    }
1164868
public function configure(ArrayNodeDefinition $builder)
  {
    $builder
      ->addDefaultsIfNotSet()
      ->children()
        ->arrayNode('templates')
          ->children()
            ->scalarNode("dir")->defaultNull()->end()
            ->scalarNode("file")->defaultValue("default.twig")->end()
          ->end()
        ->end()
        ->arrayNode('output')
          ->children()
            ->scalarNode("dir")->defaultNull()->end()
            ->scalarNode("file")->isRequired()->end()
          ->end()
        ->end()
        ->end()
    ->end();
  }
1186056
public function register($identifier, $value)
    {
        parent::register($identifier, $value);

        $sql = sprintf(
            'INSERT INTO %s (`entityId`, `data`) set (`%s`, `%s`);',
            $this->mysql->quote($this->section),
            $this->mysql->quote($identifier),
            $this->decorator->normalizeValue($value)
        );
        $result = $this->mysql->query($sql);

        if (false === $result) {

            $this->registry[$this->section][$identifier] = null;

            $this->throwException(
                'Error occurred while registering an entity: ',
                $this->mysql->errorInfo()
            );
        }
    }
198194
protected function addUndoVerify(Builder $builder): void
    {
        $builder->macro('undoVerify', function (Builder $builder) {
            return $builder->update(['verified_at' => null]);
        });
    }
261486
public function inverseRelations(SchemaBuilder $builder)
    {
        /**
         * Inverse process is relation specific.
         */
        foreach ($this->relations as $relation) {
            $definition = $relation->getDefinition();

            if ($definition->needInversion()) {
                if (!$relation instanceof InversableRelationInterface) {
                    throw new DefinitionException(sprintf(
                        "Unable to inverse relation '%s'.'%s', relation schema '%s' is non inversable",
                        $definition->sourceContext()->getClass(),
                        $definition->getName(),
                        get_class($relation)
                    ));
                }

                $inversed = $relation->inverseDefinition($builder, $definition->getInverse());
                foreach ($inversed as $definition) {
                    $this->registerRelation($builder, $definition);
                }
            }
        }
    }
560992
protected function defineEntity(ClassDefinition $class)
    {
        $class->property($this->name)->asString();

        $class->property($this->slug)->asString();

        $class->property($this->role)->asString();

        $class->property($this->bio)->asObject(Html::class);

        $class->property($this->articles)->asType(BlogArticle::collectionType());

        $this->defineMetadata($class);
    }
1320260
protected function define(ClassDefinition $class)
    {
        $class->property($this->name)->asString();

        $class->property($this->value)->asString();
    }
1326988
public static function metaForTemplateEntity(
        ClassMetadataBuilder $builder
    ): void {
        $unidirectionalOneToOn = $builder->createOneToOne(
            TemplateEntity::getDoctrineStaticMeta()->getSingular(),
            TemplateEntity::class
        );
        $unidirectionalOneToOn->addJoinColumn(
            Inflector::tableize(
                TemplateEntity::getDoctrineStaticMeta()->getSingular()
            ) . '_' . IdFieldInterface::PROP_ID,
            IdFieldInterface::PROP_ID,
            true
        )->build();
    }