![]() |
custom seacrh function in model - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: custom seacrh function in model (/showthread.php?tid=76012) |
custom seacrh function in model - pws - 04-07-2020 Hello, I'm new on CI4 and i like to create advanced search form for list clients by email,name and other data.. I have the userModel: namespace App\Models; use CodeIgniter\Database\ConnectionInterface; use CodeIgniter\Model; class UserModel extends Model { protected $table = 'users'; protected $primaryKey = 'id'; protected $allowedFields = ['role', 'email','password','display_name','banned','active','expired_at','token','partner']; protected $returnType = 'array'; protected function search($role=null,$display_name=null,$email=null){ /** find data related to variables **/ } } How must do on function search to get result? ( not required all search fields are filled!) Thanks.. |