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