1 | <?php |
||
13 | class LegislativePeriod |
||
14 | { |
||
15 | public $id; |
||
16 | public $name; |
||
17 | public $slug; |
||
18 | protected $legislature; |
||
19 | protected $country; |
||
20 | protected $legislativePeriodData; |
||
21 | |||
22 | /** |
||
23 | * Creates a new instance |
||
24 | * |
||
25 | * @param array $legislativePeriodData Popolo legislative period data |
||
26 | * @param Legislature $legislature legislature for this legislative period |
||
27 | * @param Country @country country for this legislative period |
||
28 | */ |
||
29 | 9 | public function __construct($legislativePeriodData, $legislature, $country) |
|
39 | |||
40 | /** |
||
41 | * Getter for public attributes |
||
42 | * |
||
43 | * @param string $prop the attribute to get |
||
44 | * |
||
45 | * @return mixed |
||
46 | */ |
||
47 | 9 | public function __get($prop) |
|
55 | |||
56 | /** |
||
57 | * Return the start date of the legislative period |
||
58 | * |
||
59 | * If this is unknown, it returns null. |
||
60 | * |
||
61 | * @return string|null |
||
62 | */ |
||
63 | 3 | private function getStartDate() |
|
70 | |||
71 | /** |
||
72 | * Return the end date of the legislative period |
||
73 | * |
||
74 | * If this is unknown, it returns null. |
||
75 | * |
||
76 | * @return string|null |
||
77 | */ |
||
78 | 3 | private function getEndDate() |
|
85 | |||
86 | /** |
||
87 | * Return the URL to CSV of members during this legislative period |
||
88 | * |
||
89 | * @return string |
||
90 | */ |
||
91 | 3 | private function getCsvUrl() |
|
97 | |||
98 | /** |
||
99 | * Return parsed data from the CSV of members during the period |
||
100 | * |
||
101 | * This returns a list of one dict per row of the CSV file, where |
||
102 | * the keys are the column headers. |
||
103 | * |
||
104 | * @return array |
||
105 | */ |
||
106 | 3 | public function csv() |
|
113 | } |
||
114 |