protected function populate(int $allocation_id, &$allocation) { if ($allocation == null) { $allocation = new logistic_requirement_resource_allocation((int) $allocation_id); $allocation->set_location_id($this->unmarshal($this->db->f('location_id'), 'int')); $allocation->set_requirement_id($this->unmarshal($this->db->f('requirement_id'), 'string')); $allocation->set_resource_id($this->unmarshal($this->db->f('resource_id'), 'int')); $allocation->set_resource_type_descr($this->unmarshal($this->db->f('resource_type_descr'), 'string')); $allocation->set_location_code($this->unmarshal($this->db->f('location_code'), 'string')); $allocation->set_fm_bim_item_address($this->unmarshal($this->db->f('fm_bim_item_address'), 'string')); $allocation->set_allocated_amount($this->unmarshal($this->db->f('count'), 'int')); $allocation->set_inventory_id($this->unmarshal($this->db->f('inventory_id'), 'int')); $allocation->set_ticket_id($this->unmarshal($this->db->f('ticket_id'), 'int')); $fm_bim_name = $this->unmarshal($this->db->f('fm_bim_item_name'), 'string'); $allocation->set_fm_bim_item_name($fm_bim_name); } return $allocation; }