Пример #1
0
 /**
  * @param Field $field
  * @param $entity
  * @param $applicationConfiguration
  * @return mixed
  */
 public function field(Field $field, $entity, ApplicationConfiguration $applicationConfiguration)
 {
     $accessor = PropertyAccess::createPropertyAccessorBuilder()->enableMagicCall()->getPropertyAccessor();
     $value = $accessor->getValue($entity, $field->getName());
     if ($value instanceof DateTime) {
         $value = $value->format($applicationConfiguration->dateFormat);
     } else {
         if (is_array($value)) {
             $value = $this->recursiveImplode(', ', $value);
         }
     }
     return $value;
 }