Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CodeIgniter\Entity Setter doesn't work #2013

Closed
ghost opened this issue May 17, 2019 · 1 comment
Closed

CodeIgniter\Entity Setter doesn't work #2013

ghost opened this issue May 17, 2019 · 1 comment

Comments

@ghost
Copy link

ghost commented May 17, 2019

Hi,

Impossible to use the CodeIgniter\Entity setter with the 4.0.0-beta.3 release while it works well
with 4.0.0-beta.1.

You can just run the example:
https://codeigniter4.github.io/userguide/models/entities.html?highlight=entity#handling-business-logic to realize the malfunction.

public function setPassword(string $pass) {
        $this->password = password_hash($pass, PASSWORD_BCRYPT);

        return $this;
}
@iRedds
Copy link
Collaborator

iRedds commented May 17, 2019

A few days ago the logic of the Entity changed. Now the data is stored in the $attributes property.
Try this

$this->attributes['password'] = password_hash($pass, PASSWORD_BCRYPT);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants