1 | <?php |
||
11 | class ScoreModel extends Model implements Score |
||
12 | { |
||
13 | /** |
||
14 | * {@inheritDoc} |
||
15 | */ |
||
16 | protected $fillable = ['attribute_id', 'value']; |
||
17 | |||
18 | /** |
||
19 | * {@inheritDoc} |
||
20 | */ |
||
21 | protected $table = 'specifications_scores'; |
||
22 | |||
23 | /** |
||
24 | * {@inheritDoc} |
||
25 | */ |
||
26 | protected $casts = [ |
||
27 | 'value' => 'json', |
||
28 | ]; |
||
29 | |||
30 | /** |
||
31 | * Helper method to quickly instantiate a new ScoreModel. |
||
32 | * |
||
33 | * @return \Pbmedia\Specifications\Laravel\Models\ScoreModel |
||
34 | */ |
||
35 | public static function withValue($value): ScoreModel |
||
39 | |||
40 | /** |
||
41 | * Returns the value attribute. |
||
42 | * |
||
43 | * @return mixed |
||
44 | */ |
||
45 | public function getValue() |
||
49 | |||
50 | /** |
||
51 | * Returns the value attribute. |
||
52 | * |
||
53 | * @return mixed |
||
54 | */ |
||
55 | public function getAttributeScore(): AttributeScore |
||
59 | |||
60 | /** |
||
61 | * Defines the relationship with the AttributeModel. |
||
62 | * |
||
63 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
64 | */ |
||
65 | public function Attribute(): BelongsTo |
||
69 | |||
70 | /** |
||
71 | * Defines the relationship with the model that will be specified. |
||
72 | * |
||
73 | * @return \Illuminate\Database\Eloquent\Relations\MorphTo |
||
74 | */ |
||
75 | public function Specifiable(): MorphTo |
||
79 | } |
||
80 |