Password::bankAccounts()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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
        'email', // @todo acho que nao deveria ter isso aqui
26
        'url', // @todo acho que nao deveria ter isso aqui
27
        'obs'
28
    ];
29
30
    protected $mappingProperties = array(
31
        /**
32
         * User Info
33
         */
34
        'value' => [
35
            'type' => 'string',
36
            "analyzer" => "standard",
37
        ],
38
        'date' => [
39
            'type' => 'string',
40
            "analyzer" => "standard",
41
        ],
42
    );
43
44
    /**
45
     * Get the owning passwordable model.
46
     * 
47
     * Esse é o morph sem ser de many to many
48
     */
49
    public function passwordable()
50
    {
51
        return $this->morphTo();
52
    }
53
54
    /**
55
     * Get all of the bankAccounts that are assigned this tag.
56
     * Esse é o morph de many to many
57
     */
58
    public function bankAccounts()
59
    {
60
        return $this->morphedByMany(BankAccount::class, 'passwordable');
61
    }
62
63
64
65
66
67
68
    // /**
69
    //  * Get all of the slaves that are assigned this tag.
70
    //  */
71
    // public function persons()
72
    // {
73
    //     return $this->morphedByMany(\Illuminate\Support\Facades\Config::get('sitec.core.models.person', \Telefonica\Models\Actors\Person::class), 'passwordable');
74
    // }
75
76
    // /**
77
    //  * Get all of the users that are assigned this tag.
78
    //  */
79
    // public function users()
80
    // {
81
    //     return $this->morphedByMany(\Illuminate\Support\Facades\Config::get('sitec.core.models.user', \App\Models\User::class), 'passwordable');
82
    // }
83
}
84