1 | <?php |
||
7 | class GetData implements GetDataInterface |
||
8 | { |
||
9 | protected $value; |
||
10 | |||
11 | function __construct($value) |
||
15 | |||
16 | /** |
||
17 | * get all the data in the table as an array |
||
18 | */ |
||
19 | protected function getAllData() |
||
23 | |||
24 | public function all() |
||
28 | |||
29 | /** |
||
30 | * Get the actual fetched row and return an array |
||
31 | */ |
||
32 | protected function toArray() |
||
36 | |||
37 | /** |
||
38 | * Convert the fetched row to json |
||
39 | */ |
||
40 | protected function toJson() |
||
44 | |||
45 | /** |
||
46 | * Get the output of the first jsondecoded element |
||
47 | */ |
||
48 | public function first() |
||
52 | |||
53 | /** |
||
54 | * Get the count of the fetch element |
||
55 | */ |
||
56 | public function getCount() |
||
60 | } |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.