Welcome Guest, Not a member yet? Register   Sign In
Model validation vs validationService and required field
#4

I'm not sure it's a bug.
Within the model->update function, if you want to update only one or two fields of your database record, it make sense that the function do not apply all required rules.
Otherwise thing's like that won't work :
PHP Code:
<?php
$data 
= [
    'active' => 1,
];
$userModel->update([123], $data); 

But i think it should be documented as an important notice in the Modeling Data » Using CodeIgniter’s Model documentation, because it can really be confusing that *required* rules can be ignored.
Reply


Messages In This Thread
RE: Model validation vs validationService and required field - by Tomv13 - 08-29-2022, 12:48 AM



Theme © iAndrew 2016 - Forum software by © MyBB