Open geek-at opened 3 years ago
I have a few classes extended using the described initialization method of class User extends dbObject {}
class User extends dbObject {}
Now I'm creating a new item like so
$user = new User; $user->firstname = $_REQUEST['firstname']; $user->lastname = $_REQUEST['lastname']; $user->save();
Which works perfectly but now I want to add a value that's decided by another class like
$user = new User; $user->firstname = $_REQUEST['firstname']; $user->lastname = $_REQUEST['lastname']; $ip = new IpVerification; $allowed = $ip->where('ip','127.0.0.1')->getOne()->allowed; $user->is_admin = $allowed; $user->save();
The save never goes through because the "where" statement is for some reason added to the $user query too (which fails because the fields are not the same.
Is this intentionally and how can I work around it?
I have a few classes extended using the described initialization method of
class User extends dbObject {}
Now I'm creating a new item like so
Which works perfectly but now I want to add a value that's decided by another class like
The save never goes through because the "where" statement is for some reason added to the $user query too (which fails because the fields are not the same.
Is this intentionally and how can I work around it?