Returns corresponding object indicated by MongoDBRef

@param $fieldName
@return mixed
@throws InvalidReferenceException
335226
public function readRef($fieldName)
    {
        $oRef = $this->readNestedAttribute($fieldName);
        if (!\MongoDBRef::isRef($oRef)) {
            throw new InvalidReferenceException();
        }
        if (isset($this->dbRefs) && isset($this->dbRefs[$fieldName])) {
            $modelInstance = $this->instantiateModel($this->dbRefs[$fieldName]);
        } else if ($this->getDI()->has('mongoMapper')) {
            $modelInstance = $this->getDI()->get('mongoMapper')->resolveModel($oRef['$ref']);
        } else {
            return $oRef;
        }
        return forward_static_call(array($modelInstance, 'findById'), $oRef['$id']);
    }
698181
protected function getCollectionFromObjectByReference()
    {
        $object       = $this->getObject();
        $refl         = $this->getClassMetadata()->getReflectionClass();
        $reflProperty = $refl->getProperty($this->getCollectionName());

        $reflProperty->setAccessible(true);

        return $reflProperty->getValue($object);
    }
1273824
public function isSingleValuedReference(string $fieldName) : bool
    {
        return isset($this->fieldMappings[$fieldName]['association']) &&
            $this->fieldMappings[$fieldName]['association'] === self::REFERENCE_ONE;
    }
473606
public function getField($field)
    {
        $result = array_filter($this->getFields(), function($input) use ($field) {
            return $field === $input->getName();
        });

        return reset($result);
    }
187709
public function get($name, $default = null)
  {
    $name = $this->get_field_name($name);
    $dotPos = strpos($name, '.');
    if (!$dotPos && $default === null)
    {
      return $this->__get($name);
    }
    $this->load_if_needed($dotPos ? substr($name, 0, $dotPos) : $name);
    $ref = $this->get_field_reference($name, FALSE, $default);
    return $ref;
  }
1291532
public function getField($fieldName)
    {
        if (array_key_exists($fieldName, $this->_message)) {
            return $this->_message[$fieldName];
        } else {
            return null;
        }
    }
945390
protected static function getStubFromArray(string $fieldName, array $field) : array
    {
        // Try our best to find the field name
        if (empty($field['name']) && !empty($fieldName)) {
            $field['name'] = $fieldName;
        }

        if (empty($field['name'])) {
            throw new InvalidArgumentException("Field array is missing 'name' key");
        }
        if (empty($field['type'])) {
            throw new InvalidArgumentException("Field array is missing 'type' key");
        }

        return [
            $field['name'] => $field,
        ];
    }
524223
public function getFieldMappingByDbFieldName(string $dbFieldName) : array
    {
        foreach ($this->fieldMappings as $mapping) {
            if ($mapping['name'] === $dbFieldName) {
                return $mapping;
            }
        }

        throw MappingException::mappingNotFoundByDbName($this->name, $dbFieldName);
    }
1080333
public function decodeObject($string, $fieldName = null)
    {
        if (empty($string)) {
            return new \stdClass();
        }
        $object = self::decode($string, $fieldName);
        if (is_string($object)) {
            $object = self::decode($object, $fieldName);
        }
        if (!is_object($object)) {
            throw new \Exception('The field '.$fieldName.' is not a JSON object as expected.');
        }

        return $object;
    }
1065261
public function getField($fieldName)
    {
        trigger_error('Method getField is deprecated since EXT:solr 10 and will be removed  in EXT:solr 11. Please use document[$fieldname] without the array key value.', E_USER_DEPRECATED);
        return isset($this->fields[$fieldName]) ? ['value' => $this->fields[$fieldName]] : false;
    }
8277
private function getFieldType($fieldName, $documentDefinition)
    {
        foreach ($documentDefinition->fields as $fieldTypeDefinition) {
            if ($fieldTypeDefinition->slug === $fieldName) {
                return $fieldTypeDefinition->type;
            }
        }

        throw new \Exception('Unknown field type for field' . $fieldName . ' in document ' . $this->document->path);
    }
158430
public function getFieldByDbName(string $dbFieldName): ?FieldMetadataInterface
    {
        foreach ($this->fieldsMetadata as $fieldMetadata) {
            if ($dbFieldName === $fieldMetadata->getDbFieldName()) {
                return $fieldMetadata;
            }
        }

        return null;
    }
486131
public function getInvalidInputExceptionFor(string $fieldName)
    {
        return isset($this->invalidInputExceptions[$fieldName])
                ? $this->invalidInputExceptions[$fieldName]
                : null;
    }
791410
public static function convertToDb($value)
    {
        return $value instanceof ExtReference ?
            \MongoDBRef::create($value->getRef(), $value->getId()) :
            null;
    }
554151
private function mapFieldName($fieldName)
    {
        if (isset($this->fieldNameMapping[$fieldName])) {
            $fieldName = $this->fieldNameMapping[$fieldName];
        }

        return $fieldName;
    }
152632
public function getFieldBc($fieldName)
    {
        if (array_key_exists($fieldName, $this->bcFields)) {
            return $this->bcFields[$fieldName];
        }

        return $fieldName;
    }
986679
public function isCollectionValuedReference(string $fieldName) : bool
    {
        return isset($this->fieldMappings[$fieldName]['association']) &&
            $this->fieldMappings[$fieldName]['association'] === self::REFERENCE_MANY;
    }