public function enum(string $property): EnumPropertyColumnDefiner
    {
        $this->verifyProperty(__METHOD__, $property);
        $type       = $this->class->getPropertyType($property);
        $isNullable = $type->isNullable();
        $enumType   = $type->nonNullable();

        if (!($enumType instanceof ObjectType)) {
            throw InvalidArgumentException::format(
                'Invalid enum property \'%s\': must map to an object type, %s given',
                $property, $type->asTypeString()
            );
        }

        $class = $enumType->getClass();

        return $this->relation($property)->asEmbedded()->enum($class, $isNullable);
    }
public function enum(string $property): EnumPropertyColumnDefiner
    {
        $this->verifyProperty(__METHOD__, $property);
        $type       = $this->class->getPropertyType($property);
        $isNullable = $type->isNullable();
        $enumType   = $type->nonNullable();

        if (!($enumType instanceof ObjectType)) {
            throw InvalidArgumentException::format(
                'Invalid enum property \'%s\': must map to an object type, %s given',
                $property, $type->asTypeString()
            );
        }

        $class = $enumType->getClass();

        return $this->relation($property)->asEmbedded()->enum($class, $isNullable);
    }
public function enum ( string $ property ) : EnumPropertyColumnDefiner { $ this -> verifyProperty ( __METHOD__ , $ property ) ; $ type = $ this -> class -> getPropertyType ( $ property ) ; $ isNullable = $ type -> isNullable ( ) ; $ enumType = $ type -> nonNullable ( ) ; if ( ! ( $ enumType instanceof ObjectType ) ) { throw InvalidArgumentException :: format ( 'Invalid enum property \'%s\': must map to an object type, %s given' , $ property , $ type -> asTypeString ( ) ) ; } $ class = $ enumType -> getClass ( ) ; return $ this -> relation ( $ property ) -> asEmbedded ( ) -> enum ( $ class , $ isNullable ) ; }
Defines a property containing an enum class.

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

@param string $property

@return EnumPropertyColumnDefiner
@throws InvalidArgumentException
Defines a property containing an enum class .