Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Illuminate\Auth;
4
 
5
use Illuminate\Contracts\Auth\Authenticatable as UserContract;
6
 
7
class GenericUser implements UserContract
8
{
9
    /**
10
     * All of the user's attributes.
11
     *
12
     * @var array
13
     */
14
    protected $attributes;
15
 
16
    /**
17
     * Create a new generic User object.
18
     *
19
     * @param  array  $attributes
20
     * @return void
21
     */
22
    public function __construct(array $attributes)
23
    {
24
        $this->attributes = $attributes;
25
    }
26
 
27
    /**
28
     * Get the name of the unique identifier for the user.
29
     *
30
     * @return string
31
     */
32
    public function getAuthIdentifierName()
33
    {
34
        return 'id';
35
    }
36
 
37
    /**
38
     * Get the unique identifier for the user.
39
     *
40
     * @return mixed
41
     */
42
    public function getAuthIdentifier()
43
    {
44
        return $this->attributes[$this->getAuthIdentifierName()];
45
    }
46
 
47
    /**
48
     * Get the password for the user.
49
     *
50
     * @return string
51
     */
52
    public function getAuthPassword()
53
    {
54
        return $this->attributes['password'];
55
    }
56
 
57
    /**
58
     * Get the "remember me" token value.
59
     *
60
     * @return string
61
     */
62
    public function getRememberToken()
63
    {
64
        return $this->attributes[$this->getRememberTokenName()];
65
    }
66
 
67
    /**
68
     * Set the "remember me" token value.
69
     *
70
     * @param  string  $value
71
     * @return void
72
     */
73
    public function setRememberToken($value)
74
    {
75
        $this->attributes[$this->getRememberTokenName()] = $value;
76
    }
77
 
78
    /**
79
     * Get the column name for the "remember me" token.
80
     *
81
     * @return string
82
     */
83
    public function getRememberTokenName()
84
    {
85
        return 'remember_token';
86
    }
87
 
88
    /**
89
     * Dynamically access the user's attributes.
90
     *
91
     * @param  string  $key
92
     * @return mixed
93
     */
94
    public function __get($key)
95
    {
96
        return $this->attributes[$key];
97
    }
98
 
99
    /**
100
     * Dynamically set an attribute on the user.
101
     *
102
     * @param  string  $key
103
     * @param  mixed  $value
104
     * @return void
105
     */
106
    public function __set($key, $value)
107
    {
108
        $this->attributes[$key] = $value;
109
    }
110
 
111
    /**
112
     * Dynamically check if a value is set on the user.
113
     *
114
     * @param  string  $key
115
     * @return bool
116
     */
117
    public function __isset($key)
118
    {
119
        return isset($this->attributes[$key]);
120
    }
121
 
122
    /**
123
     * Dynamically unset a value on the user.
124
     *
125
     * @param  string  $key
126
     * @return void
127
     */
128
    public function __unset($key)
129
    {
130
        unset($this->attributes[$key]);
131
    }
132
}