CompanyTrait   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 2
c 1
b 0
f 0
dl 0
loc 10
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A company() 0 3 1
1
<?php
2
3
namespace SimpleCMS\Company\Traits;
4
5
use SimpleCMS\Company\Models\Company;
6
7
/**
8
 * 动态单元Trait
9
 *
10
 * @author Dennis Lui <[email protected]>
11
 *
12
 * 使用:
13
 * 
14
 *   use \SimpleCMS\Company\Traits\CompanyTrait;
15
 *
16
 * @use \Illuminate\Database\Eloquent\Model
17
 * @use \Illuminate\Database\Eloquent\Concerns\HasRelationships
18
 *
19
 */
20
trait CompanyTrait
21
{
22
23
    /**
24
     * 企业公司
25
     * @return mixed
26
     */
27
    public function company()
28
    {
29
        return $this->belongsTo(Company::class);
30
    }
31
32
}
33