/**
  * @param DisplayAttributeForReportForm $displayAttribute
  * @param RedBeanModel $model
  * @return mixed $value
  */
 protected function resolveRawValueByModel(DisplayAttributeForReportForm $displayAttribute, RedBeanModel $model)
 {
     $type = $displayAttribute->getDisplayElementType();
     $attribute = $displayAttribute->getResolvedAttribute();
     if ($type == 'CurrencyValue') {
         return $model->{$attribute}->value;
     } elseif ($type == 'User') {
         $realAttributeName = $displayAttribute->getResolvedAttributeRealAttributeName();
         return $model->{$realAttributeName}->id;
     } elseif ($type == 'DropDown') {
         return $model->{$attribute}->value;
     } elseif (null != ($rawValueRelatedAttribute = $displayAttribute->getRawValueRelatedAttribute())) {
         return $model->{$attribute}->{$rawValueRelatedAttribute};
     } else {
         return $this->resolveModelAttributeValueForPenultimateRelation($model, $attribute, $displayAttribute);
     }
 }