public function withTypeInColumn(string $columnName, $classTypeValue): SubClassDefinitionDefiner
    {
        return new SubClassDefinitionDefiner(
            $this->orm,
            $this->parentDefinition,
            function (MapperDefinition $subClassDefinition) use ($columnName, $classTypeValue) {
                foreach ($subClassDefinition->getColumns() as $column) {
                    $this->parentDefinition->addColumn($column->asNullable());
                }
                $subClassDefinition->setColumns($this->parentDefinition->getColumns());

                call_user_func(
                    $this->callback,
                    function (Table $parentTable) use ($subClassDefinition, $columnName, $classTypeValue) {
                        $finalizedSubClassDefinition = $subClassDefinition->finalize($parentTable->getName());

                        return new EmbeddedSubClassObjectMapping(
                            $parentTable,
                            $finalizedSubClassDefinition,
                            $columnName,
                            $classTypeValue
                        );
                    },
                    $subClassDefinition
                );
            }
        );
    }
public function withTypeInColumn(string $columnName, $classTypeValue): SubClassDefinitionDefiner
    {
        return new SubClassDefinitionDefiner(
            $this->orm,
            $this->parentDefinition,
            function (MapperDefinition $subClassDefinition) use ($columnName, $classTypeValue) {
                foreach ($subClassDefinition->getColumns() as $column) {
                    $this->parentDefinition->addColumn($column->asNullable());
                }
                $subClassDefinition->setColumns($this->parentDefinition->getColumns());

                call_user_func(
                    $this->callback,
                    function (Table $parentTable) use ($subClassDefinition, $columnName, $classTypeValue) {
                        $finalizedSubClassDefinition = $subClassDefinition->finalize($parentTable->getName());

                        return new EmbeddedSubClassObjectMapping(
                            $parentTable,
                            $finalizedSubClassDefinition,
                            $columnName,
                            $classTypeValue
                        );
                    },
                    $subClassDefinition
                );
            }
        );
    }
public function withTypeInColumn ( string $ columnName , $ classTypeValue ) : SubClassDefinitionDefiner { return new SubClassDefinitionDefiner ( $ this -> orm , $ this -> parentDefinition , function ( MapperDefinition $ subClassDefinition ) use ( $ columnName , $ classTypeValue ) { foreach ( $ subClassDefinition -> getColumns ( ) as $ column ) { $ this -> parentDefinition -> addColumn ( $ column -> asNullable ( ) ) ; } $ subClassDefinition -> setColumns ( $ this -> parentDefinition -> getColumns ( ) ) ; call_user_func ( $ this -> callback , function ( Table $ parentTable ) use ( $ subClassDefinition , $ columnName , $ classTypeValue ) { $ finalizedSubClassDefinition = $ subClassDefinition -> finalize ( $ parentTable -> getName ( ) ) ; return new EmbeddedSubClassObjectMapping ( $ parentTable , $ finalizedSubClassDefinition , $ columnName , $ classTypeValue ) ; } , $ subClassDefinition ) ; } ) ; }
Defines the subclass to be embedded in the parent table
and will store a marker value within a column of the class type.

This is the using the single table inheritance pattern.

**Example:**
<code>
$map->type(Player::class);
$map->toTable('players');

$map->idToPrimaryKey('id');
$map->column('type')->asEnum(['footballer', 'cricketer', 'bowler']);
$map->property('name')->to('name')->asVarchar(255);

$map->subclass()->withTypeInColumn('type', 'footballer')->define(function (MapperDefinition $map) {
$map->type(Footballer::class);
$map->property('club')->to('club')->asVarchar(255);
});

$map->subclass()->withTypeInColumn('type', 'cricketer')->define(function (MapperDefinition $map) {
$map->type(Cricketer::class);
$map->property('battingAverage')->to('batting_average')->asInt();

$map->subclass()->withTypeInColumn('type', 'bowler')->define(function (MapperDefinition $map) {
$map->type(Bowler::class);
$map->property('bowlingAverage')->to('bowling_average')->asInt();
});
});
</code>

**This will create a schema as such:**
<code>
| players                                                     |
|-----------------|-------------------------------------------|
| id              | INT PRIMARY KEY                           |
| name            | VARCHAR(255)                              |
| club            | NULLABLE VARCHAR(255)                     |
| batting_average | NULLABLE INT                              |
| bowling_average | NULLABLE INT                              |
| type            | ENUM('footballer', 'cricketer', 'bowler') |
</code>

@param string $columnName
@param mixed  $classTypeValue

@return SubClassDefinitionDefiner
Defines the subclass to be embedded in the parent table and will store a marker value within a column of the class type .