| 1 | <?php |
||
| 10 | class Generic implements DataCollectorInterface |
||
| 11 | { |
||
| 12 | protected $title = 'Unnamed'; |
||
| 13 | protected $icon; |
||
| 14 | protected $data = []; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Get the title of this data collector |
||
| 18 | * |
||
| 19 | * @return string |
||
| 20 | */ |
||
| 21 | 1 | public function getTitle() |
|
| 25 | |||
| 26 | /** |
||
| 27 | * Set title for this data collector |
||
| 28 | * |
||
| 29 | * @param string $title |
||
| 30 | */ |
||
| 31 | 1 | public function setTitle($title) |
|
| 35 | |||
| 36 | /** |
||
| 37 | * Get the icon HTML markup |
||
| 38 | * If icon not set - returns empty string |
||
| 39 | * |
||
| 40 | * For example font-awesome icons: <i class="fa fa-pie-chart"></i> |
||
| 41 | * See: http://fortawesome.github.io/Font-Awesome/icons/ |
||
| 42 | * |
||
| 43 | * @return string |
||
| 44 | */ |
||
| 45 | 2 | public function getIcon() |
|
| 49 | |||
| 50 | /** |
||
| 51 | * Set icon for HTML markup |
||
| 52 | * |
||
| 53 | * This should be font-awesome icon eg. fa-circle-thin |
||
| 54 | * See: http://fortawesome.github.io/Font-Awesome/icons/ |
||
| 55 | * |
||
| 56 | * @param string $icon |
||
| 57 | */ |
||
| 58 | 2 | public function setIcon($icon) |
|
| 62 | |||
| 63 | /** |
||
| 64 | * Get data from the data collector |
||
| 65 | * |
||
| 66 | * @return array |
||
| 67 | */ |
||
| 68 | 1 | public function getData() |
|
| 72 | |||
| 73 | /** |
||
| 74 | * Set data for data collector |
||
| 75 | * |
||
| 76 | * @param array $data |
||
| 77 | */ |
||
| 78 | 1 | public function setData(array $data) |
|
| 82 | } |
||
| 83 |