1 | <?php |
||
11 | class Business extends Base |
||
12 | { |
||
13 | use AsOrganization; |
||
14 | |||
15 | public $incrementing = false; |
||
16 | protected $casts = [ |
||
17 | 'code' => 'string', |
||
18 | ]; |
||
19 | protected $primaryKey = 'code'; |
||
20 | protected $keyType = 'string'; |
||
21 | |||
22 | /** |
||
23 | * The attributes that are mass assignable. |
||
24 | * |
||
25 | * @var array |
||
26 | */ |
||
27 | protected $fillable = [ |
||
28 | 'name', |
||
29 | 'code', |
||
30 | 'language_code', |
||
31 | 'money_code', |
||
32 | 'user_id' |
||
33 | ]; |
||
34 | |||
35 | protected $mappingProperties = array( |
||
36 | 'name' => [ |
||
37 | 'type' => 'string', |
||
38 | "analyzer" => "standard", |
||
39 | ], |
||
40 | 'code' => [ |
||
41 | 'type' => 'string', |
||
42 | "analyzer" => "standard", |
||
43 | ], |
||
44 | 'language_code' => [ |
||
45 | 'type' => 'string', |
||
46 | "analyzer" => "standard", |
||
47 | ], |
||
48 | 'money_code' => [ |
||
49 | 'type' => 'string', |
||
50 | "analyzer" => "standard", |
||
51 | ], |
||
52 | 'user_id' => [ |
||
53 | 'type' => 'string', |
||
54 | "analyzer" => "standard", |
||
55 | ], |
||
56 | ); |
||
57 | |||
58 | // /** |
||
59 | // * Get all of the owning businessable models. |
||
60 | // */ |
||
61 | // @todo A relacao porliformica é diferente nesse caso, podemos ter varias pessoas associadas ao mesmo item. |
||
62 | // public function businessable() |
||
63 | // { |
||
64 | // return $this->morphTo(); //, 'businessable_type', 'businessable_code' |
||
65 | // } |
||
66 | |||
67 | /** |
||
68 | * Get all of the users that are assigned this tag. |
||
69 | */ |
||
70 | public function users() |
||
78 | |||
79 | public function datas() |
||
83 | |||
84 | |||
85 | } |