lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadataInfo.php
public function setDiscriminatorField($discriminatorField)
    {
        if ($discriminatorField === null) {
            $this->discriminatorField = null;

            return;
        }

        // Handle array argument with name/fieldName keys for BC
        if (is_array($discriminatorField)) {
            if (isset($discriminatorField['name'])) {
                $discriminatorField = $discriminatorField['name'];
            } elseif (isset($discriminatorField['fieldName'])) {
                $discriminatorField = $discriminatorField['fieldName'];
            }
        }

        foreach ($this->fieldMappings as $fieldMapping) {
            if ($discriminatorField == $fieldMapping['name']) {
                throw MappingException::discriminatorFieldConflict($this->name, $discriminatorField);
            }
        }

        $this->discriminatorField = $discriminatorField;
    }
public function setDiscriminatorField($discriminatorField)
    {
        if ($discriminatorField === null) {
            $this->discriminatorField = null;

            return;
        }

        // Handle array argument with name/fieldName keys for BC
        if (is_array($discriminatorField)) {
            if (isset($discriminatorField['name'])) {
                $discriminatorField = $discriminatorField['name'];
            } elseif (isset($discriminatorField['fieldName'])) {
                $discriminatorField = $discriminatorField['fieldName'];
            }
        }

        foreach ($this->fieldMappings as $fieldMapping) {
            if ($discriminatorField == $fieldMapping['name']) {
                throw MappingException::discriminatorFieldConflict($this->name, $discriminatorField);
            }
        }

        $this->discriminatorField = $discriminatorField;
    }
public function setDiscriminatorField ( $ discriminatorField ) { if ( $ discriminatorField === null ) { $ this -> discriminatorField = null ; return ; } // Handle array argument with name/fieldName keys for BC if ( is_array ( $ discriminatorField ) ) { if ( isset ( $ discriminatorField [ 'name' ] ) ) { $ discriminatorField = $ discriminatorField [ 'name' ] ; } elseif ( isset ( $ discriminatorField [ 'fieldName' ] ) ) { $ discriminatorField = $ discriminatorField [ 'fieldName' ] ; } } foreach ( $ this -> fieldMappings as $ fieldMapping ) { if ( $ discriminatorField == $ fieldMapping [ 'name' ] ) { throw MappingException :: discriminatorFieldConflict ( $ this -> name , $ discriminatorField ) ; } } $ this -> discriminatorField = $ discriminatorField ; }
Sets the discriminator field.

The field name is the the unmapped database field. Discriminator values
are only used to discern the hydration class and are not mapped to class
properties.

@param string $discriminatorField

@throws MappingException If the discriminator field conflicts with the
"name" attribute of a mapped field.
Sets the discriminator field .