/var/www/vhosts/ihelp.ro/httpdocs/src/Model/Entity
Edit: /var/www/vhosts/ihelp.ro/httpdocs/src/Model/Entity/User.php (2244B)
true
];
/**
* Fields that are excluded from JSON versions of the entity.
*/
protected $_hidden = [
'password',
'new_password',
];
/**
* Fields virtual.
*/
protected $_virtual = [
'name',
'status_change_password',
'email_send_forgort_password',
];
/**
* _setPassword
*/
protected function _setPassword(string $password): ?string
{
if ($this->status_change_password != true) {
if (strlen($password) > 7) {
return (new DefaultPasswordHasher())->hash($password);
}
}
return $password;
}
/**
* _setNewPassword
*/
protected function _setNewPassword(string $password): ?string
{
if ($this->status_change_password != true) {
if (strlen($password) > 7) {
return (new DefaultPasswordHasher())->hash($password);
}
}
return $password;
}
/**
* _getName
*/
protected function _getName()
{
$name = '';
if (!empty($this->id)) {
$profileEntity = TableRegistry::get('Profiles');
$profile = $profileEntity->find()
->where(['Profiles.user_id' => $this->id])
->first();
if ($profile) {
$name = $profile->first_name . ' ' . $profile->last_name;
}
}
if (empty(trim($name))) {
$name = 'User#' . $this->uuid;
}
return $name;
}
/**
* _getName
*/
protected function _getStatusChangePassword($status_change_password)
{
return $status_change_password;
}
/**
* _getName
*/
protected function _getEmailSendForgortPassword($email_send_forgort_password)
{
return $email_send_forgort_password;
}
}