EntityModel::fields()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Hechoenlaravel\JarvisFoundation\EntityGenerator;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
/**
8
 * Class EntityModel
9
 * @package Hechoenlaravel\JarvisFoundation\EntityGenerator
10
 */
11
class EntityModel extends Model
12
{
13
    /**
14
     * @var string
15
     */
16
    protected $table = "app_entities";
17
18
    /**
19
     * @var array
20
     */
21
    protected $fillable = [
22
        'namespace',
23
        'name',
24
        'slug',
25
        'description',
26
        'prefix',
27
        'table_name',
28
        'locked',
29
        'create_table'
30
    ];
31
32
    /**
33
     * Get the Table name for the Entity
34
     * @return string
35
     */
36
    public function getTableName()
37
    {
38
        return $this->table_name;
39
    }
40
41
    public function fields()
42
    {
43
        return $this->hasMany('Hechoenlaravel\JarvisFoundation\FieldGenerator\FieldModel', 'entity_id');
44
    }
45
}
46