Пример #1
0
 public function tableHeaders(Entity $entity, array $allowed)
 {
     $labels = [];
     $attributes = $entity->getAttributes();
     foreach ($allowed as $label => $attribute) {
         // use label provided
         if (is_string($label)) {
             $labels[] = $label;
             // use entity config label
         } elseif (isset($attributes[$attribute]['label'])) {
             $labels[] = $attributes[$attribute]['label'];
             // use the attribute code
         } else {
             $labels[] = $attribute;
         }
     }
     return $labels;
 }