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;
        }
    }
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;
        }
    }
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 ; } }
Gets value from first referenced entity that has it

@param FieldInterface $field
Gets value from first referenced entity that has it