1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Telefonica\Models\Digital; |
4
|
|
|
|
5
|
|
|
use Pedreiro\Models\Base; |
6
|
|
|
use Bancario\Models\BankAccount; |
7
|
|
|
use Telefonica\Models\Digital\Account; |
8
|
|
|
|
9
|
|
|
class Password extends Base |
10
|
|
|
{ |
11
|
|
|
|
12
|
|
|
protected $organizationPerspective = false; |
13
|
|
|
|
14
|
|
|
protected $table = 'identity_passwords'; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* The attributes that are mass assignable. |
18
|
|
|
* |
19
|
|
|
* @var array |
20
|
|
|
*/ |
21
|
|
|
protected $fillable = [ |
22
|
|
|
'value', |
23
|
|
|
'date', |
24
|
|
|
'is_active', |
25
|
|
|
'obs' |
26
|
|
|
]; |
27
|
|
|
|
28
|
|
|
protected $mappingProperties = array( |
29
|
|
|
/** |
30
|
|
|
* User Info |
31
|
|
|
*/ |
32
|
|
|
'value' => [ |
33
|
|
|
'type' => 'string', |
34
|
|
|
"analyzer" => "standard", |
35
|
|
|
], |
36
|
|
|
'date' => [ |
37
|
|
|
'type' => 'string', |
38
|
|
|
"analyzer" => "standard", |
39
|
|
|
], |
40
|
|
|
); |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* Get the owning passwordable model. |
44
|
|
|
* |
45
|
|
|
* Esse é o morph sem ser de many to many |
46
|
|
|
*/ |
47
|
|
|
public function passwordable() |
48
|
|
|
{ |
49
|
|
|
return $this->morphTo(); |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* Get all of the bankAccounts that are assigned this tag. |
54
|
|
|
* Esse é o morph de many to many |
55
|
|
|
*/ |
56
|
|
|
public function bankAccounts() |
57
|
|
|
{ |
58
|
|
|
return $this->morphedByMany(BankAccount::class, 'passwordable'); |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
|
62
|
|
|
|
63
|
|
|
|
64
|
|
|
|
65
|
|
|
|
66
|
|
|
// /** |
67
|
|
|
// * Get all of the slaves that are assigned this tag. |
68
|
|
|
// */ |
69
|
|
|
// public function persons() |
70
|
|
|
// { |
71
|
|
|
// return $this->morphedByMany(\Illuminate\Support\Facades\Config::get('sitec.core.models.person', \Telefonica\Models\Actors\Person::class), 'passwordable'); |
72
|
|
|
// } |
73
|
|
|
|
74
|
|
|
// /** |
75
|
|
|
// * Get all of the users that are assigned this tag. |
76
|
|
|
// */ |
77
|
|
|
// public function users() |
78
|
|
|
// { |
79
|
|
|
// return $this->morphedByMany(\Illuminate\Support\Facades\Config::get('sitec.core.models.user', \App\Models\User::class), 'passwordable'); |
80
|
|
|
// } |
81
|
|
|
} |
82
|
|
|
|