Esempio n. 1
0
 public function __construct($key, $name = null, $description = null)
 {
     $this->key = $key;
     if ($name === null) {
         $name = Strings::humanize($key);
     }
     $this->name = $name;
     if ($description === null) {
         $description = Strings::humanize($name);
     }
     $this->description = $description;
 }
Esempio n. 2
0
 /**
  * @return DataCollectionAttribute[]
  */
 public function getAttributes()
 {
     $attrs = [];
     $source = $this->_getMapper();
     if ($source !== null) {
         $attributes = $source->getRawAttributes();
         if ($attributes) {
             foreach ($attributes as $attribute) {
                 $attrs[] = new DataCollectionAttribute($attribute->sourceProperty(), Strings::humanize($attribute->name()), $attribute->getDescription());
             }
         }
     }
     return $attrs;
 }