public function delete($id) { $this->db->trans_start(); # remove bookmark related employee $this->load->model("BookmarkModel"); $bookmark = new BookmarkModel(); $bookmark->delete_by_employee($id); # remove follower related employee $this->load->model("FollowerModel"); $follower = new FollowerModel(); $follower->delete_by_employee($id); # remove activity related employee $this->load->model("EmployeeActivityModel"); $activity = new EmployeeActivityModel(); $activity->delete_by_employee($id); # remove cv list of experience related employee $this->load->model("ExperienceModel"); $experience = new ExperienceModel(); $experience->delete_by_employee($id); # remove cv list of education related employee $this->load->model("PortfolioModel"); $education = new PortfolioModel(); $education->delete_by_employee($id); # remove thread list related employee $this->load->model("ThreadModel"); $thread = new ThreadModel(); $thread->delete_by_employee($id); # remove application ever sent $this->load->model("ApplicationModel"); $application = new ApplicationModel(); $application->delete_by_employee($id); # remove employee itself $condition = array(EmployeeModel::$primary_key => $id); $this->db->delete(EmployeeModel::$table_name, $condition); $this->db->trans_complete(); return $this->db->trans_status(); }