Gets value from first referenced entity that has it

@param FieldInterface $field
973055
protected function getValueFromReferencedEntity(FieldInterface $field)
    {
        $references = $this->model->referredIn($field->name());
        foreach ($references as $foreign => $reference) {
            $entity = $this->accessor->getPropertyValue($this->instance, $reference->container());

            if ($entity === null) {
                continue;
            }

            $value = $this->accessor->getPropertyValue($entity, $foreign);
            $this->accessor->setPropertyValue($this->instance, $field->name(), $value);
            break;
        }
    }
436192
public function get($field)
    {
        $client = $this->getClient();

        return $client->hget($this->getKey()->getName(), $field);
    }
684982
public function getField(string $field)
    {
        if (isset($this->_record[$field]))
            return $this->_record[$field];
        return null;
    }
1267416
public function getEntityAttributeValue($field)
    {
        if ($field) {
            $functionName = 'get'.ucfirst($field);

            // Avoid error when the widget refer to a property that has been removed
            if (!method_exists($this, $functionName)) {
                return;
            }

            $fieldValue = $this->{$functionName}();
        } else {
            $fieldValue = null;
        }

        return $fieldValue;
    }
473606
public function getField($field)
    {
        $result = array_filter($this->getFields(), function($input) use ($field) {
            return $field === $input->getName();
        });

        return reset($result);
    }
474253
public function getValueFromFieldDescription(
        $object,
        FieldDescriptionInterface $fieldDescription,
        array $params = []
    ) {
        if (isset($params['loop']) && $object instanceof \ArrayAccess) {
            throw new \RuntimeException('remove the loop requirement');
        }

        $value = null;

        try {
            $value = $fieldDescription->getValue($object);
        } catch (NoValueException $e) {
            if ($fieldDescription->getAssociationAdmin()) {
                $value = $fieldDescription->getAssociationAdmin()->getNewInstance();
            }
        }

        return $value;
    }
536685
public function getFormFieldValueOptions(FieldInterface $field)
    {
        $fieldOptions = $this->getFieldOptions($field);

        $formFieldOptions = parent::getFormFieldValueOptions($field);
        if (isset($fieldOptions['nbRows'])) {
            $formFieldOptions['attr'] = ['rows' => $fieldOptions['nbRows']];
        }

        return $formFieldOptions;
    }
325847
public function getValue(SourceInterface $source)
    {
        if (!$source->has($this->field)) {
            if ($this->isIgnoreMissing) {
                throw new IgnoreFieldException();
            }

            if ($this->isDefaultValueSet) {
                return $this->defaultValue;
            }

            throw new SourceFieldMissingException(sprintf('Field "%s" does not exists in source', $this->field));
        }

        $value = $source->get($this->field);

        if ($this->converter) {
            $value = call_user_func($this->converter, $value);
        }

        if ($this->isTrim) {
            $value = trim($value);
        }

        if ($this->isIgnoreEmpty && empty($value)) {
            throw new IgnoreFieldException();
        }

        return $value;
    }
59199
function getFieldValue( $field )
    {
        if ( isset( $this->callbackData[$field] ) )
        {
            return $this->callbackData[ $field ];
        }

        $this->logger->writeTimedString( "field $field does not exist.", 'getFieldValue failed' );
        return null;
    }
435232
public function getField($field)
    {
        // Skip invalid fields
        $fields = $this->compositeDatabaseFields();
        if (!isset($fields[$field])) {
            return null;
        }

        // Check bound object
        if ($this->record instanceof DataObject) {
            $key = $this->getName() . $field;
            return $this->record->getField($key);
        }

        // Check local record
        if (isset($this->record[$field])) {
            return $this->record[$field];
        }
        return null;
    }
967307
public function getFormFieldValueOptions(FieldInterface $field)
    {
        $formFieldOptions = [];
        $formFieldOptions['choices'] = array_flip($this->getFieldOptionsArray($field));
        $formFieldOptions['expanded'] = $this->isExpanded;
        $formFieldOptions['multiple'] = $this->getIsMultipleChoice($field);

        return $formFieldOptions;
    }
307784
private function getPropertyValue($object, Property $field)
    {
        return $this->accessor->getValue($object, $field->getProperty());
    }
1309437
public function getValueFromFieldDescription($object, FieldDescriptionInterface $fieldDescription)
    {
        $value = null;

        if (!$object) {
            return $value;
        }

        try {
            $value = $fieldDescription->getValue($object);
        } catch (NoValueException $e) {
            if ($fieldDescription->getAssociationAdmin()) {
                $value = $fieldDescription->getAssociationAdmin()->getNewInstance();
            }
        }

        return $value;
    }
529638
public function getFieldValue(object $document, string $field)
    {
        if ($document instanceof GhostObjectInterface && $field !== $this->identifier && ! $document->isProxyInitialized()) {
            $document->initializeProxy();
        }

        return $this->reflFields[$field]->getValue($document);
    }
1279237
public function getFieldValue($object, $field)
    {
        $this->assertObjectInstance($object);

        return $this->getField($field)->get($object);
    }
1098548
public function getFieldValue($document, $field)
    {
        if (isset($this->reflFields[$field])) {
            return $this->reflFields[$field]->getValue($document);
        }
    }
628368
public function getIntermediate($field = null)
    {
        return $field === null
            ? $this->intermediate
            : $this->intermediate[$field];
    }