Point::persons()   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 Gamer\Models;
4
5
use Support\Models\Base;
6
7
class Point extends Base
8
{
9
10
    /**
11
     * The attributes that are mass assignable.
12
     *
13
     * @var array
14
     */
15
    protected $fillable = [
16
        'name',
17
        'pointable_type',
18
        'pointable_id',
19
        'point_type_id'
20
    ];
21
22
    protected $mappingProperties = array(
23
        /**
24
         * User Info
25
         */
26
        'name' => [
27
            'type' => 'string',
28
            "analyzer" => "standard",
29
        ],
30
        'pointable_type' => [
31
            'type' => 'string',
32
            "analyzer" => "standard",
33
        ],
34
        'pointable_id' => [
35
            'type' => 'string',
36
            "analyzer" => "standard",
37
        ],
38
        'point_type_id' => [
39
            'type' => 'string',
40
            "analyzer" => "standard",
41
        ],
42
    );
43
44
    /**
45
     * Get all of the users that are assigned this tag.
46
     */
47
    public function users()
48
    {
49
        return $this->morphedByMany(\Illuminate\Support\Facades\Config::get('sitec.core.models.user', \App\Models\User::class), 'pointable');
50
    }
51
52
    /**
53
     * Get all of the slaves that are assigned this tag.
54
     */
55
    public function persons()
56
    {
57
        return $this->morphedByMany(\Illuminate\Support\Facades\Config::get('sitec.core.models.person', \Telefonica\Models\Actors\Person::class), 'pointable');
58
    }
59
}
60