Welcome Guest, Not a member yet? Register   Sign In
How use ModelObject->save($entityObject) well?
#1

(This post was last modified: 07-19-2022, 04:24 AM by cwwjsyc.)

Model has a snowflakeId as primaryKey.  
in ver 4.2.1  can not allow primaryKey in $allowedFields array.

How can use Entity and Model correctly ?

PHP Code:
$userArray = [
    'key' => snowFlakeId(), //primaryKey
    'userName' => 'XXXX',
];

$this->userModel->save(new \App\Entities\UserEntity($userArray)); 
Reply


Messages In This Thread
How use ModelObject->save($entityObject) well? - by cwwjsyc - 07-19-2022, 04:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB