| 1 | <?php |
||
| 16 | trait DataTrait |
||
| 17 | { |
||
| 18 | |||
| 19 | private $data = null; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Returns the data items currently available, ensures that result is at leas empty array |
||
| 23 | * @param boolean $refresh whether the data should be re-fetched from persistent storage. |
||
| 24 | * @return array the list of data items currently available in this data provider. |
||
| 25 | */ |
||
| 26 | 1 | public function getData($refresh = false) |
|
| 38 | |||
| 39 | /** |
||
| 40 | * Manually set data. This is for special cases only, |
||
| 41 | * usually should not be used. |
||
| 42 | * |
||
| 43 | * @param array $data |
||
| 44 | */ |
||
| 45 | public function setData($data) |
||
| 49 | |||
| 50 | abstract protected function fetchData(); |
||
| 51 | } |
||
| 52 |