protected function populate(int $price_item_id, &$price_item) { if ($price_item == null) { $price_item = new rental_contract_price_item($this->unmarshal($this->db->f('id'), 'int')); $price_item->set_price_item_id($this->unmarshal($this->db->f('price_item_id'), 'int')); $price_item->set_contract_id($this->unmarshal($this->db->f('contract_id'), 'int')); $price_item->set_title($this->unmarshal($this->db->f('title'), 'string')); $price_item->set_agresso_id($this->unmarshal($this->db->f('agresso_id'), 'string')); $price_item->set_is_area($this->unmarshal($this->db->f('is_area'), 'bool')); $price_item->set_is_one_time($this->unmarshal($this->db->f('is_one_time'), 'bool')); $price_item->set_is_billed($this->unmarshal($this->db->f('is_billed'), 'bool')); $price_item->set_price($this->unmarshal($this->db->f('price'), 'float')); $price_item->set_area($this->unmarshal($this->db->f('area'), 'float')); $price_item->set_count($this->unmarshal($this->db->f('count'), 'int')); $price_item->set_total_price($this->unmarshal($this->db->f('total_price'), 'float')); $price_item->set_date_start($this->unmarshal($this->db->f('date_start'), 'int')); $price_item->set_date_end($this->unmarshal($this->db->f('date_end'), 'int')); $price_type_id = (int) $this->db->f('type'); $price_item->set_price_type_id($price_type_id); $price_item->set_price_type_title($price_type_id); } return $price_item; }