1 | <?php |
||
12 | class SocialConnection extends Model |
||
13 | { |
||
14 | |||
15 | protected $table = 'social_connections'; |
||
16 | |||
17 | protected $fillable = ['provider', 'user_id', 'social_id', 'oauth_version', 'data']; |
||
18 | |||
19 | protected $casts = [ |
||
20 | 'data' => 'json' |
||
21 | ]; |
||
22 | |||
23 | /** |
||
24 | * The users model name. |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | protected static $userModel = 'LGL\Core\Auth\Users\EloquentUser'; |
||
29 | |||
30 | |||
31 | 3 | public function user() |
|
35 | |||
36 | |||
37 | 3 | public function scopeOfProvider($query, $provider) |
|
38 | { |
||
39 | 3 | return is_array($provider) ? $query->whereIn('provider', $provider) : $query->where('provider', $provider); |
|
40 | } |
||
41 | |||
42 | |||
43 | 3 | public function scopeOfProviderId($query, $socialId) |
|
44 | { |
||
45 | 3 | return is_array($socialId) ? $query->whereIn('social_id', $socialId) : $query->where('social_id', $socialId); |
|
46 | } |
||
47 | |||
48 | |||
49 | 3 | public function scopeOfCredentials($query, $provider, $socialId) |
|
50 | { |
||
51 | 3 | return $query->where('provider', $provider)->where('social_id', $socialId); |
|
52 | } |
||
53 | |||
54 | |||
55 | 3 | public function getUser() |
|
59 | |||
60 | |||
61 | /** |
||
62 | * @param $user |
||
63 | */ |
||
64 | 3 | public function setUser($user) |
|
70 | |||
71 | |||
72 | /** |
||
73 | * Get the users model. |
||
74 | * |
||
75 | * @return string |
||
76 | */ |
||
77 | 3 | public static function getUsersModel() |
|
81 | |||
82 | |||
83 | /** |
||
84 | * Set the users model. |
||
85 | * |
||
86 | * @param string $usersModel |
||
87 | * |
||
88 | * @return void |
||
89 | */ |
||
90 | 27 | public static function setUsersModel($usersModel) |
|
94 | |||
95 | } |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.