Total Complexity | 4 |
Total Lines | 45 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | class Entity extends Model |
||
8 | { |
||
9 | /** |
||
10 | * The table associated with the model. |
||
11 | * |
||
12 | * @var string |
||
13 | */ |
||
14 | protected $table = 'entities'; |
||
15 | |||
16 | /** |
||
17 | * The attributes that are mass assignable. |
||
18 | * |
||
19 | * @var array |
||
20 | */ |
||
21 | protected $fillable = [ |
||
22 | 'id', |
||
23 | 'module_id', |
||
24 | 'record_id', |
||
25 | 'creator_id', |
||
26 | ]; |
||
27 | |||
28 | protected $primaryKey = 'id'; // TODO: Change to "uid" to make joins withs modules tables possible ??? |
||
29 | public $incrementing = false; |
||
30 | |||
31 | // Allow Eloquent to return id as string instead of int. |
||
32 | protected $casts = ['id' => 'string']; |
||
33 | |||
34 | protected function initTablePrefix() |
||
35 | { |
||
36 | $this->tablePrefix = env('UCCELLO_TABLE_PREFIX', 'uccello_'); |
||
37 | } |
||
38 | |||
39 | public function creator() |
||
42 | } |
||
43 | |||
44 | public function getModuleAttribute() |
||
45 | { |
||
46 | return Module::find($this->module_id); |
||
|
|||
47 | } |
||
48 | |||
49 | public function getRecordAttribute() |
||
52 | } |
||
53 | } |
||
54 |
Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.