protected function populate(int $project_id, &$project) { if ($project == null) { $project = new logistic_project((int) $project_id); $project->set_name($this->unmarshal($this->db->f('name'), 'string')); $project->set_description($this->unmarshal($this->db->f('description'), 'string')); $project->set_project_type_id($this->unmarshal($this->db->f('project_type_id'), 'int')); if ($project->get_project_type_id() && $project->get_project_type_id() > 0) { $project->set_project_type_label($this->get_project_type_label($this->unmarshal($this->db->f('project_type_id'), 'int'))); } $project->set_start_date($this->unmarshal($this->db->f('start_date'), 'int')); $project->set_end_date($this->unmarshal($this->db->f('end_date'), 'int')); } return $project; }