123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- <?php
- # app/MicroApi/Services/ResponseHandler.php
- namespace App\MicroApi\Items;
- use Illuminate\Contracts\Auth\Authenticatable;
- class UserItem implements Authenticatable
- {
- public $id;
- public $name;
- public $email;
- public $password;
- public $status;
- protected $hidden = ['password'];
- /**
- * 将 JSON 序列化对象数据填充到 UserItem
- */
- public function fillAttributes($data)
- {
- if (is_object($data)) {
- $data = get_object_vars($data);
- }
- foreach ($data as $key => $value) {
- if (in_array($key, $this->hidden)) {
- continue;
- }
- switch ($key) {
- case 'id':
- $this->id = $value;
- break;
- case 'name':
- $this->name = $value;
- break;
- case 'email':
- $this->email = $value;
- break;
- case 'status':
- $this->status = $value;
- break;
- default:
- break;
- }
- }
- return $this;
- }
- /**
- * Get the name of the unique identifier for the user.
- *
- * @return string
- */
- public function getAuthIdentifierName()
- {
- return 'id';
- }
- /**
- * Get the unique identifier for the user.
- *
- * @return mixed
- */
- public function getAuthIdentifier()
- {
- return $this->id;
- }
- /**
- * Get the password for the user.
- *
- * @return string
- */
- public function getAuthPassword()
- {
- // TODO: Implement getAuthPassword() method.
- }
- /**
- * Get the token value for the "remember me" session.
- *
- * @return string
- */
- public function getRememberToken()
- {
- // TODO: Implement getRememberToken() method.
- }
- /**
- * Set the token value for the "remember me" session.
- *
- * @param string $value
- * @return void
- */
- public function setRememberToken($value)
- {
- // TODO: Implement setRememberToken() method.
- }
- /**
- * Get the column name for the "remember me" token.
- *
- * @return string
- */
- public function getRememberTokenName()
- {
- // TODO: Implement getRememberTokenName() method.
- }
- }
|