Welcome Guest, Not a member yet? Register   Sign In
You must use the "set" method to update an entry. (Again)
#1

Hello everyone,

I'm currently migrating my CI3 project to CI4, but unfortunately I'm struggling with I guess one of the easier things Sad . I already searched the forums and tried some things, but couldn't find a fitting solution. I think my main problem is that the error doesn't really tell me what's wrong and I have no clue what could bring me a step closer to the solution at this point.

In general I only want to create a user in my user model.

This is my Controller Test Case
PHP Code:
public function CreateUserTest()
    {
        
$userModel = new UserModel();
        
$returnValue $userModel->create_user('MrXXX''12345678''Max''Muster''[email protected]');
    } 

This is my UserModel declaration and definitions
PHP Code:
protected $DBGroup 'users';
protected 
$table 'user';
protected 
$allowedFields = ['role_id, first_name, last_name, username, password, '
    
'email_address, mail_me, ack_round, language, referee, xp, uuid, '
    
'activation_token, activation, dsgvo, notified']; 

This is my insert statement inside the createuser method
PHP Code:
$this->set('uuid''UUID()'false);
    
//$this->set('referee', $referee);   
    
$data = ['username' => $username,
            
'first_name' => $first_name,
            
'last_name' => $last_name,
            
'email_address' => $email_address,
            
'password' => $hash,            
            
'activation_token' => $token];
    
var_dump($data);
    
$insert $this->insert($data); 

The result from var_dump looks like this:
Code:
array(6) { ["username"]=> string(5) "MrXXX" ["first_name"]=> string(3) "Max" ["last_name"]=> string(6) "Muster" ["email_address"]=> string(15) "[email protected]" ["password"]=> string(60) "CleandUpCleandUp..." ["activation_token"]=> string(254) "CleandUpCleandUp..." }

Thx for your help!
Reply


Messages In This Thread
You must use the "set" method to update an entry. (Again) - by Petrusilius - 10-12-2020, 02:01 PM



Theme © iAndrew 2016 - Forum software by © MyBB