| Total Complexity | 1 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class Item extends Model |
||
| 9 | { |
||
| 10 | use HasFactory, |
||
|
|
|||
| 11 | Concerns\Item\Attribute, |
||
| 12 | Concerns\Item\Event, |
||
| 13 | Concerns\Item\QueryScope, |
||
| 14 | Concerns\Item\Relation; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * {@inheritDoc} |
||
| 18 | */ |
||
| 19 | protected $fillable = [ |
||
| 20 | 'quantity_per_bundle', |
||
| 21 | 'bundle_quantity', |
||
| 22 | 'quantity', |
||
| 23 | 'is_order_custom_quantity', |
||
| 24 | ]; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * {@inheritDoc} |
||
| 28 | */ |
||
| 29 | protected $casts = [ |
||
| 30 | 'quantity_per_bundle' => 'integer', |
||
| 31 | 'bundle_quantity' => 'integer', |
||
| 32 | 'quantity' => 'integer', |
||
| 33 | 'is_order_custom_quantity' => 'boolean', |
||
| 34 | ]; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Count value of "quantity" attribute. |
||
| 38 | * |
||
| 39 | * @return int |
||
| 40 | */ |
||
| 41 | 2 | public function countQuantityAttribute(): int |
|
| 46 |