/
var
/
www
/
vhosts
/
ihelp.ro
/
_OLD
/
src
/
Model
/
Entity
/
/var/www/vhosts/ihelp.ro/_OLD/src/Model/Entity
mkdir
upload
Name
Size
Mode
Actions
Cause.php
610
0644
edit
dl
rm
CauseImage.php
449
0644
edit
dl
rm
Profile.php
1365
0644
edit
dl
rm
User.php
2121
0644
edit
dl
rm
Edit:
/var/www/vhosts/ihelp.ro/_OLD/src/Model/Entity/User.php
(2121B)
<?php declare(strict_types=1); namespace App\Model\Entity; use Authentication\PasswordHasher\DefaultPasswordHasher; use Cake\ORM\Entity; /** * User Entity * * @property int $id * @property string $uuid * @property int $role_id * @property string $email * @property string $password * @property bool $accept_gdpr * @property bool $is_active * @property \Cake\I18n\FrozenTime $created * @property \Cake\I18n\FrozenTime $modified * * @property \App\Model\Entity\Role $role * @property \App\Model\Entity\Cause[] $causes * @property \App\Model\Entity\Message[] $messages * @property \App\Model\Entity\Order[] $orders * @property \App\Model\Entity\PaymentLog[] $payment_logs * @property \App\Model\Entity\ProductFavorite[] $product_favorites * @property \App\Model\Entity\Product[] $products * @property \App\Model\Entity\Profile[] $profiles */ class User extends Entity { /** * Fields that can be mass assigned using newEntity() or patchEntity(). * * Note that when '*' is set to true, this allows all unspecified fields to * be mass assigned. For security purposes, it is advised to set '*' to false * (or remove it), and explicitly make individual fields accessible as needed. * * @var array */ protected $_accessible = [ '*' => true, 'role_id' => true, 'email' => true, 'password' => true, 'accept_gdpr' => true, 'is_active' => true, 'created' => true, 'modified' => true, 'role' => true, 'causes' => true, 'messages' => true, 'orders' => true, 'payment_logs' => true, 'product_favorites' => true, 'products' => true, 'profiles' => true, ]; /** * Fields that are excluded from JSON versions of the entity. * * @var array */ protected $_hidden = [ 'password', ]; // Add this method protected function _setPassword(string $password): ?string { if (strlen($password) > 0) { return (new DefaultPasswordHasher())->hash($password); } } }
Save
cmd:
run