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; }
/** * @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; }