Welcome Guest, Not a member yet? Register   Sign In
Do CodeIgniter 4 model instances already have Query Builder methods loaded?
#2

You usually do not have to load them manually. No matter whether I use
Code:
$model = model('App\Model\MyModel::class);
$model->find($id);
$model->where('id>',100)->get()->getResult();

or a ResourcePresenter which includes the model
Code:
protected $modelName = "App\Model\MyModel";
...
$this->model->find($id);
$this->model->where('id>',100)->get()->getResult();
I could always directly use the query builder.
Reply


Messages In This Thread
RE: Do CodeIgniter 4 model instances already have Query Builder methods loaded? - by Kimotu - 06-10-2024, 12:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB