Welcome Guest, Not a member yet? Register   Sign In
custom seacrh function in model

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!)


Theme © iAndrew 2016 - Forum software by © MyBB