/** * load current status (last one set) * if new project, status is 0 (draft) */ public function get_status() { $obj = new tfk_project_status(); if ($pid = $this->get_uid()) { if ($obj->load_list(array('where' => 'project_id=' . $pid, 'order' => 'log_date DESC'))) { return $obj->next(true); } } // no status (new project or not loaded) $obj->set('action_code', 0); $obj->set('log_date', 'NOW'); return $obj; }