Ejemplo n.º 1
0
 function get_objects($object, $options)
 {
     $url = 'https://' . $this->node . '/api/getObjects.sjs';
     $options['object'] = $object;
     list($status, $data) = $this->client->send($url, $options);
     return DemocracyInAction_Parser::parse_objects($data);
 }
Ejemplo n.º 2
0
 function get_objects($object, $options = array())
 {
     $url = 'https://' . $this->node . '/api/getObjects.sjs';
     $options['object'] = $object;
     $data = array();
     $more_objects = true;
     $page = 0;
     $paginated = false;
     while ($more_objects) {
         $mod_options = $options;
         if (!isset($options['limit'])) {
             $mod_options['limit'] = $page * $this->pagination_limit . ',' . $this->pagination_limit;
             $paginated = true;
         }
         list($status, $new_data) = $this->client->send($url, $mod_options);
         $new_parsed_data = DemocracyInAction_Parser::parse_objects($new_data);
         if (!empty($new_parsed_data)) {
             $data = array_merge($data, $new_parsed_data);
         }
         if (count($new_parsed_data) != $this->pagination_limit || !$paginated) {
             $more_objects = false;
         }
         $page++;
     }
     return $data;
 }
Ejemplo n.º 3
0
 function parse_object($xml)
 {
     $result = DemocracyInAction_Parser::parse_objects($xml);
     return $result[0];
 }