Example #1
0
 public function __construct($legislation_id = 0)
 {
     parent::__construct('legislation', $legislation_id);
     if ($legislation_id) {
         $state = new State($this->region_id());
         $logo = LOGO_PATH . strtolower('state_' . $state->state_abbr() . '_' . $this->current_chamber()) . '.png';
         $location = $state->state_name() . ' State ' . $this->current_chamber();
         list($category_id, $category_name) = Category::legislation_get_category($this->current_location());
         $committee = Category::get_location($this->current_location());
         $this->legislator_ids = $this->get_legislator_ids();
         $legislators = array();
         if (!empty($this->legislator_ids)) {
             foreach ($this->legislator_ids as $id) {
                 $legislators[] = new Legislator($id);
             }
         }
         $this->sponsors = Legislation::get_legislator_data($legislators, $committee);
         $this->bill = $this->_extract_bill_id();
         $this->image = $logo;
         $this->bill_location = $location;
         $this->location_description = $committee;
         $this->category = array('id' => $category_id, 'name' => $category_name);
         $this->status = new Status($this->status_id());
         $this->date_introduced_parts = get_date_parts($this->date_introduced());
         $this->date_heard_parts = get_date_parts($this->date_heard());
         $this->_get_public_opinion();
         $this->comment_data = $this->get_comment_data();
     }
 }