where('is_active', 1)->findAll(); } // Get a specific flight by ID public function getFlightById($flightId) { return $this->where('flight_id', $flightId)->first(); } // Get flights by plan ID public function getFlightsByPlanId($planId) { return $this->where('plan_id', $planId)->where('is_active', 1)->findAll(); } // Insert a new flight record public function insertFlight($data) { return $this->insert($data); } // Update an existing flight record public function updateFlight($flightId, $data) { return $this->where('flight_id', $flightId)->set($data)->update(); } // Soft delete (deactivate) a flight record public function deactivateFlight($flightId) { return $this->where('flight_id', $flightId)->set(['is_active' => 0])->update(); } }