public function object() : EmbeddedValueObjectDefiner
    {
        return new EmbeddedValueObjectDefiner($this->orm,
            function (callable $mapperLoader, string $issetColumnName = null, bool $isUnique) {
                // Use null object mapper as parent to load the columns
                /** @var IEmbeddedObjectMapper $tempMapper */
                $tempMapper  = $mapperLoader(new NullObjectMapper());
                $columnNames = [];
                $embeddedObjectTable = $tempMapper->getDefinition()->getTable();
                
                if ($issetColumnName && !$embeddedObjectTable->hasColumn($issetColumnName)) {
                    $this->definition->addColumn(new Column($issetColumnName, new Boolean()));
                }

                foreach ($embeddedObjectTable->getColumns() as $column) {
                    $this->definition->addColumn($issetColumnName ? $column->asNullable() : $column);
                    $columnNames[] = $column->getName();
                }


                if ($isUnique) {
                    $this->definition->unique($this->definition->getTableName() . '_' . implode('_', $columnNames) . '_unique_index')
                        ->on($columnNames);
                }

                call_user_func($this->callback, function (
                    $idString,
                    Table $parentTable,
                    IObjectMapper $parentMapper
                ) use (
                    $mapperLoader,
                    $issetColumnName
                ) {
                    return new EmbeddedObjectRelation($idString, $mapperLoader($parentMapper), $issetColumnName);
                });
            });
    }
public function object() : EmbeddedValueObjectDefiner
    {
        return new EmbeddedValueObjectDefiner($this->orm,
            function (callable $mapperLoader, string $issetColumnName = null, bool $isUnique) {
                // Use null object mapper as parent to load the columns
                /** @var IEmbeddedObjectMapper $tempMapper */
                $tempMapper  = $mapperLoader(new NullObjectMapper());
                $columnNames = [];
                $embeddedObjectTable = $tempMapper->getDefinition()->getTable();
                
                if ($issetColumnName && !$embeddedObjectTable->hasColumn($issetColumnName)) {
                    $this->definition->addColumn(new Column($issetColumnName, new Boolean()));
                }

                foreach ($embeddedObjectTable->getColumns() as $column) {
                    $this->definition->addColumn($issetColumnName ? $column->asNullable() : $column);
                    $columnNames[] = $column->getName();
                }


                if ($isUnique) {
                    $this->definition->unique($this->definition->getTableName() . '_' . implode('_', $columnNames) . '_unique_index')
                        ->on($columnNames);
                }

                call_user_func($this->callback, function (
                    $idString,
                    Table $parentTable,
                    IObjectMapper $parentMapper
                ) use (
                    $mapperLoader,
                    $issetColumnName
                ) {
                    return new EmbeddedObjectRelation($idString, $mapperLoader($parentMapper), $issetColumnName);
                });
            });
    }
public function object ( ) : EmbeddedValueObjectDefiner { return new EmbeddedValueObjectDefiner ( $ this -> orm , function ( callable $ mapperLoader , string $ issetColumnName = null , bool $ isUnique ) { // Use null object mapper as parent to load the columns /** @var IEmbeddedObjectMapper $tempMapper */ $ tempMapper = $ mapperLoader ( new NullObjectMapper ( ) ) ; $ columnNames = [ ] ; $ embeddedObjectTable = $ tempMapper -> getDefinition ( ) -> getTable ( ) ; if ( $ issetColumnName && ! $ embeddedObjectTable -> hasColumn ( $ issetColumnName ) ) { $ this -> definition -> addColumn ( new Column ( $ issetColumnName , new Boolean ( ) ) ) ; } foreach ( $ embeddedObjectTable -> getColumns ( ) as $ column ) { $ this -> definition -> addColumn ( $ issetColumnName ? $ column -> asNullable ( ) : $ column ) ; $ columnNames [ ] = $ column -> getName ( ) ; } if ( $ isUnique ) { $ this -> definition -> unique ( $ this -> definition -> getTableName ( ) . '_' . implode ( '_' , $ columnNames ) . '_unique_index' ) -> on ( $ columnNames ) ; } call_user_func ( $ this -> callback , function ( $ idString , Table $ parentTable , IObjectMapper $ parentMapper ) use ( $ mapperLoader , $ issetColumnName ) { return new EmbeddedObjectRelation ( $ idString , $ mapperLoader ( $ parentMapper ) , $ issetColumnName ) ; } ) ; } ) ; }
Defines an embedded value object relation.

@return EmbeddedValueObjectDefiner
@throws InvalidArgumentException
Defines an embedded value object relation .