Vocabulary   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 5
dl 0
loc 30
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A concepts() 0 3 1
A create_route() 0 3 1
1
<?php
2
3
namespace App\Models;
4
5
use Illuminate\Database\Eloquent\Relations\HasMany;
6
7
/**
8
 * App\Models\Vocabulary
9
 *
10
 * @property int $id
11
 * @property \Carbon\Carbon|null $created_at
12
 * @property \Carbon\Carbon|null $updated_at
13
 * @property \Carbon\Carbon|null $deleted_at
14
 * @property int $agent_id
15
 * @property int $created_user_id
16
 * @property int $updated_user_id
17
 * @property int|null $deleted_user_id
18
 * @property string|null $child_updated_at
19
 * @property int $child_updated_user_id
20
 * @property string $name
21
 * @property string $note
22
 * @property string $uri
23
 * @property string $url
24
 * @property string $base_domain
25
 * @property string $token
26
 * @property string $community
27
 * @property int $last_uri_id
28
 * @property int $status_id
29
 * @property string $language This is the default language for all concept properties
30
 * @property string $languages
31
 * @property int $profile_id
32
 * @property string $ns_type
33
 * @property string $prefixes
34
 * @property string $repo
35
 * @property string $prefix
36
 * @property int|null $created_by
37
 * @property int|null $updated_by
38
 * @property int|null $deleted_by
39
 * @property int|null $child_updated_by
40
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Concept[] $concepts
41
 * @property-read \App\Models\Access\User\User|null $creator
42
 * @property-read \App\Models\Access\User\User|null $eraser
43
 * @property-read mixed $project_id
44
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Import[] $imports
45
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Access\User\User[] $members
46
 * @property-read \App\Models\Profile|null $profile
47
 * @property-read \App\Models\Project|null $project
48
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Release[] $releases
49
 * @property-read \App\Models\Status $status
50
 * @property-read \App\Models\Access\User\User|null $updater
51
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Vocabulary whereAgentId($value)
52
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Vocabulary whereBaseDomain($value)
53
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Vocabulary whereChildUpdatedAt($value)
54
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Vocabulary whereChildUpdatedBy($value)
55
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Vocabulary whereChildUpdatedUserId($value)
56
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Vocabulary whereCommunity($value)
57
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Vocabulary whereCreatedAt($value)
58
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Vocabulary whereCreatedBy($value)
59
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Vocabulary whereCreatedUserId($value)
60
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Vocabulary whereDeletedAt($value)
61
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Vocabulary whereDeletedBy($value)
62
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Vocabulary whereDeletedUserId($value)
63
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Vocabulary whereId($value)
64
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Vocabulary whereLanguage($value)
65
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Vocabulary whereLanguages($value)
66
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Vocabulary whereLastUriId($value)
67
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Vocabulary whereName($value)
68
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Vocabulary whereNote($value)
69
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Vocabulary whereNsType($value)
70
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Vocabulary wherePrefix($value)
71
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Vocabulary wherePrefixes($value)
72
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Vocabulary whereProfileId($value)
73
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Vocabulary whereRepo($value)
74
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Vocabulary whereStatusId($value)
75
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Vocabulary whereToken($value)
76
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Vocabulary whereUpdatedAt($value)
77
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Vocabulary whereUpdatedBy($value)
78
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Vocabulary whereUpdatedUserId($value)
79
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Vocabulary whereUri($value)
80
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Vocabulary whereUrl($value)
81
 * @mixin \Eloquent
82
 */
83
class Vocabulary extends VocabsModel
84
{
85
    public const TABLE = 'reg_vocabulary';
86
    public $table      = self::TABLE;
87
88
    /*
89
    |--------------------------------------------------------------------------
90
    | FUNCTIONS
91
    |--------------------------------------------------------------------------
92
    */
93
94
    /**
95
     * @param int $project_id
96
     *
97
     * @return string
98
     */
99
    public static function create_route(int $project_id): string
100
    {
101
        return 'projects/' . $project_id . '/elementsets/create';
102
    }
103
104
    /*
105
    |--------------------------------------------------------------------------
106
    | RELATIONS
107
    |--------------------------------------------------------------------------
108
    */
109
110
    public function concepts(): ?HasMany
111
    {
112
        return $this->hasMany(Concept::class, 'vocabulary_id');
113
    }
114
115
    /*
116
    |--------------------------------------------------------------------------
117
    | SCOPES
118
    |--------------------------------------------------------------------------
119
    */
120
121
    /*
122
    |--------------------------------------------------------------------------
123
    | ACCESSORS
124
    |--------------------------------------------------------------------------
125
    */
126
127
    /*
128
    |--------------------------------------------------------------------------
129
    | MUTATORS
130
    |--------------------------------------------------------------------------
131
    */
132
}
133