lib/Doctrine/ODM/MongoDB/Mapping/Driver/YamlDriver.php
private function parseDiscriminatorField($discriminatorField)
    {
        if (is_string($discriminatorField)) {
            return $discriminatorField;
        }

        if ( ! is_array($discriminatorField)) {
            throw new \InvalidArgumentException('Expected array or string for discriminatorField; found: ' . gettype($discriminatorField));
        }

        if (isset($discriminatorField['name'])) {
            return (string) $discriminatorField['name'];
        }

        if (isset($discriminatorField['fieldName'])) {
            return (string) $discriminatorField['fieldName'];
        }

        throw new \InvalidArgumentException('Expected "name" or "fieldName" key in discriminatorField array; found neither.');
    }
private function parseDiscriminatorField($discriminatorField)
    {
        if (is_string($discriminatorField)) {
            return $discriminatorField;
        }

        if ( ! is_array($discriminatorField)) {
            throw new \InvalidArgumentException('Expected array or string for discriminatorField; found: ' . gettype($discriminatorField));
        }

        if (isset($discriminatorField['name'])) {
            return (string) $discriminatorField['name'];
        }

        if (isset($discriminatorField['fieldName'])) {
            return (string) $discriminatorField['fieldName'];
        }

        throw new \InvalidArgumentException('Expected "name" or "fieldName" key in discriminatorField array; found neither.');
    }
private function parseDiscriminatorField ( $ discriminatorField ) { if ( is_string ( $ discriminatorField ) ) { return $ discriminatorField ; } if ( ! is_array ( $ discriminatorField ) ) { throw new \ InvalidArgumentException ( 'Expected array or string for discriminatorField; found: ' . gettype ( $ discriminatorField ) ) ; } if ( isset ( $ discriminatorField [ 'name' ] ) ) { return ( string ) $ discriminatorField [ 'name' ] ; } if ( isset ( $ discriminatorField [ 'fieldName' ] ) ) { return ( string ) $ discriminatorField [ 'fieldName' ] ; } throw new \ InvalidArgumentException ( 'Expected "name" or "fieldName" key in discriminatorField array; found neither.' ) ; }
Parses the class or field-level "discriminatorField" option.

If the value is an array, check the "name" option before falling back to
the deprecated "fieldName" option (for BC). Otherwise, the value must be
a string.

@param array|string $discriminatorField
@return string
@throws \InvalidArgumentException if the value is neither a string nor an
array with a "name" or "fieldName" key.
Parses the class or field - level discriminatorField option .