【发布时间】:2015-09-10 15:42:13
【问题描述】:
<?php
namespace App\Model\Entity;
use Cake\ORM\Entity;
/**
* User Entity.
*/
class User extends Entity
{
/**
* Fields that can be mass assigned using newEntity() or patchEntity().
* Note that '*' is set to true, which allows all unspecified fields to be
* mass assigned. For security purposes, it is advised to set '*' to false
* (or remove), and explicitly make individual fields accessible as needed.
*
* @var array
*/
protected $_accessible = [
'*' => true,
'id' => false,
];
protected function _setPassword($value)
{
$hasher = new DefaultPasswordHasher();
return $hasher->hash($value);
}
}
这是我在 user.php 中的代码。 我正在对密码进行哈希处理并得到了这个错误
错误:找不到类“App\Model\Entity\DefaultPasswordHasher”文件 C:\xamp\htdocs\bookmarker\src\Model\Entity\User.php 行:27
【问题讨论】:
标签: cakephp-3.0