tstat_be/app/Models/TravellerModel.php

31 lines
719 B
PHP

<?php
namespace App\Models;
use CodeIgniter\Model;
class TravellerModel extends Model
{
protected $table = 'm_traveller';
protected $primaryKey = 'traveller_id';
protected $allowedFields = [ 'first_name', 'last_name', 'email', 'mobile' , 'is_active' , 'org_id' ,'created_by', 'updated_by'];
protected $useTimestamps = false; // Set to true if you want to track created_at/updated_at
public function getTravellerByEmail($email)
{
return $this->where('email', $email)->first();
}
public function updateTraveller($id, $data)
{
return $this->update($id, $data);
}
public function deleteTraveller($id)
{
return $this->delete($id);
}
}