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(); } }
public function __construct($announcement_id = 0, $get_list = false) { parent::__construct('announcement', $announcement_id); if ($get_list === false && $announcement_id) { $this->sponsor_ids = $this->get_sponsor_ids(); $sponsors = array(); if (!empty($this->sponsor_ids)) { foreach ($this->sponsor_ids as $id) { $sponsors[] = new Sponsor($id); } } $this->sponsors = Announcement::get_sponsor_data($sponsors); list($category_id, $category_name) = Category::announcement_get_category($this->id()); $this->category = array('id' => $category_id, 'name' => $category_name); $this->status = new Status($this->status_id()); $this->office = new Office($this->sponsor_id()); $this->date_beginning_parts = get_date_parts($this->date_beginning()); $this->date_ending_parts = get_date_parts($this->date_ending()); $this->calendared_parts = get_date_parts($this->calendared()); $this->vote_parts = get_date_parts($this->vote()); $this->_get_public_opinion(); $this->comment_data = $this->get_comment_data(); } }