1 | <?php |
||
5 | class Popolo |
||
6 | { |
||
7 | use Traits\ArrayGetterTrait; |
||
8 | |||
9 | private $jsonData; |
||
10 | private $collections = [ |
||
11 | 'persons' => ['Person', 'PersonCollection'], |
||
12 | 'organizations' => ['Organization', 'OrganizationCollection'], |
||
13 | 'memberships' => ['Membership', 'MembershipCollection'], |
||
14 | 'areas' => ['Area', 'AreaCollection'], |
||
15 | 'posts' => ['Post', 'PostCollection'], |
||
16 | 'events' => ['Event', 'EventCollection'], |
||
17 | ]; |
||
18 | |||
19 | /** |
||
20 | * Create a new Popolo Instance from |
||
21 | */ |
||
22 | 282 | public function __construct($jsonData) |
|
26 | |||
27 | 279 | public function __get($prop) |
|
38 | |||
39 | /** |
||
40 | * Construct from filename |
||
41 | * |
||
42 | * @param string $filename name of Popolo json file |
||
43 | * |
||
44 | * @return $this |
||
45 | */ |
||
46 | 240 | public static function fromFilename($filename) |
|
53 | |||
54 | /** |
||
55 | * Construct from URL |
||
56 | * |
||
57 | * @param string $url location of Popolo json file |
||
58 | * |
||
59 | * @return $this |
||
60 | */ |
||
61 | 3 | public static function fromUrl($url, $client = null) |
|
69 | } |
||
70 |