public function enum(string $class, bool $isNullable = false) : EnumPropertyColumnDefiner
    {
        $callback = function (EnumMapper $enumMapper) {
            $this->definition->addColumn($enumMapper->getEnumValueColumn());

            call_user_func($this->callback, function ($idString) use ($enumMapper) {
                return new EmbeddedObjectRelation(
                    $idString,
                    $enumMapper,
                    $enumMapper->getEnumValueColumn()->getName()
                );
            });
        };

        return new EnumPropertyColumnDefiner(
            $this->definition,
            function ($columnName, array $valueMap = null) use ($callback, $class, $isNullable) {
                $callback(new EnumMapper($this->orm, $isNullable, $columnName, $class, $valueMap));
            },
            function (Column $column) use ($callback, $class, $isNullable) {
                $callback(new EnumMapper($this->orm, $isNullable, $column->getName(), $class, null, $column->getType()));
            }
        );
    }
public function enum(string $class, bool $isNullable = false) : EnumPropertyColumnDefiner
    {
        $callback = function (EnumMapper $enumMapper) {
            $this->definition->addColumn($enumMapper->getEnumValueColumn());

            call_user_func($this->callback, function ($idString) use ($enumMapper) {
                return new EmbeddedObjectRelation(
                    $idString,
                    $enumMapper,
                    $enumMapper->getEnumValueColumn()->getName()
                );
            });
        };

        return new EnumPropertyColumnDefiner(
            $this->definition,
            function ($columnName, array $valueMap = null) use ($callback, $class, $isNullable) {
                $callback(new EnumMapper($this->orm, $isNullable, $columnName, $class, $valueMap));
            },
            function (Column $column) use ($callback, $class, $isNullable) {
                $callback(new EnumMapper($this->orm, $isNullable, $column->getName(), $class, null, $column->getType()));
            }
        );
    }
public function enum ( string $ class , bool $ isNullable = false ) : EnumPropertyColumnDefiner { $ callback = function ( EnumMapper $ enumMapper ) { $ this -> definition -> addColumn ( $ enumMapper -> getEnumValueColumn ( ) ) ; call_user_func ( $ this -> callback , function ( $ idString ) use ( $ enumMapper ) { return new EmbeddedObjectRelation ( $ idString , $ enumMapper , $ enumMapper -> getEnumValueColumn ( ) -> getName ( ) ) ; } ) ; } ; return new EnumPropertyColumnDefiner ( $ this -> definition , function ( $ columnName , array $ valueMap = null ) use ( $ callback , $ class , $ isNullable ) { $ callback ( new EnumMapper ( $ this -> orm , $ isNullable , $ columnName , $ class , $ valueMap ) ) ; } , function ( Column $ column ) use ( $ callback , $ class , $ isNullable ) { $ callback ( new EnumMapper ( $ this -> orm , $ isNullable , $ column -> getName ( ) , $ class , null , $ column -> getType ( ) ) ) ; } ) ; }
Defines a relation mapped to an enum class.

@see \Dms\Core\Model\Object\Enum

@param string $class
@param bool   $isNullable

@return EnumPropertyColumnDefiner
@throws InvalidArgumentException
Defines a relation mapped to an enum class .