function ban($user_id, $action_by, $warning_id, $banned_till) { $this->clear(); $this->user_id = (int) $user_id; $this->action_by = (int) $action_by; $this->warning_id = (int) $warning_id; $this->banned_till = $banned_till; $this->action_date = date("Y-m-d H:i:s"); $this->type = self::BANNED; $this->save(); $user_model = new UserModel(); $user_model->ban($user_id); }