Email   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 55
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A associations() 0 4 1
A persons() 0 4 1
A users() 0 4 1
1
<?php
2
3
namespace Telefonica\Models\Digital;
4
5
use Pedreiro\Models\Base;
6
7
class Email extends Base
8
{
9
    public $incrementing = false;
10
    protected $casts = [
11
        'email' => 'string',
12
    ];
13
    protected $primaryKey = 'email';
14
    protected $keyType = 'string'; 
15
16
    /**
17
     * The attributes that are mass assignable.
18
     *
19
     * @var array
20
     */
21
    protected $fillable = [
22
        'email',
23
        'address',
24
        'domain',
25
        'integration_id',
26
    ];
27
28
    protected $mappingProperties = array(
29
        /**
30
         * User Info
31
         */
32
        'email' => [
33
            'type' => 'string',
34
            "analyzer" => "standard",
35
        ],
36
    );
37
    
38
    /**
39
     * Get all of the slaves that are assigned this tag.
40
     */
41
    public function associations($class)
42
    {
43
        return $this->morphedByMany($class, 'emailable'); //, 'emailables', 'email_email', 'emailable_code', 'emailable_type');
44
    }
45
    
46
    /**
47
     * Get all of the slaves that are assigned this tag.
48
     */
49
    public function persons()
50
    {
51
        return $this->morphedByMany(\Illuminate\Support\Facades\Config::get('sitec.core.models.person', \Telefonica\Models\Actors\Person::class), 'emailable');
52
    }
53
54
    /**
55
     * Get all of the users that are assigned this tag.
56
     */
57
    public function users()
58
    {
59
        return $this->morphedByMany(\Illuminate\Support\Facades\Config::get('sitec.core.models.user', \App\Models\User::class), 'emailable');
60
    }
61
}
62