public function setDefaultDiscriminatorValue(?string $defaultDiscriminatorValue) : void
    {
        if ($this->isFile) {
            throw MappingException::discriminatorNotAllowedForGridFS($this->name);
        }

        if ($defaultDiscriminatorValue === null) {
            $this->defaultDiscriminatorValue = null;

            return;
        }

        if (! array_key_exists($defaultDiscriminatorValue, $this->discriminatorMap)) {
            throw MappingException::invalidDiscriminatorValue($defaultDiscriminatorValue, $this->name);
        }

        $this->defaultDiscriminatorValue = $defaultDiscriminatorValue;
    }
public function setDefaultDiscriminatorValue(?string $defaultDiscriminatorValue) : void
    {
        if ($this->isFile) {
            throw MappingException::discriminatorNotAllowedForGridFS($this->name);
        }

        if ($defaultDiscriminatorValue === null) {
            $this->defaultDiscriminatorValue = null;

            return;
        }

        if (! array_key_exists($defaultDiscriminatorValue, $this->discriminatorMap)) {
            throw MappingException::invalidDiscriminatorValue($defaultDiscriminatorValue, $this->name);
        }

        $this->defaultDiscriminatorValue = $defaultDiscriminatorValue;
    }
public function setDefaultDiscriminatorValue ( ? string $ defaultDiscriminatorValue ) : void { if ( $ this -> isFile ) { throw MappingException :: discriminatorNotAllowedForGridFS ( $ this -> name ) ; } if ( $ defaultDiscriminatorValue === null ) { $ this -> defaultDiscriminatorValue = null ; return ; } if ( ! array_key_exists ( $ defaultDiscriminatorValue , $ this -> discriminatorMap ) ) { throw MappingException :: invalidDiscriminatorValue ( $ defaultDiscriminatorValue , $ this -> name ) ; } $ this -> defaultDiscriminatorValue = $ defaultDiscriminatorValue ; }
Sets the default discriminator value to be used for this class
Used for SINGLE_TABLE inheritance mapping strategies if the document has no discriminator value

@throws MappingException
Sets the default discriminator value to be used for this class Used for SINGLE_TABLE inheritance mapping strategies if the document has no discriminator value