| Total Complexity | 4 |
| Total Lines | 56 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class Denomination extends Model |
||
| 10 | { |
||
| 11 | use HasFactory, |
||
| 12 | Concerns\Denomination\Attribute, |
||
| 13 | Concerns\Denomination\Event, |
||
| 14 | Concerns\Denomination\Relation; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Filepath value for image. |
||
| 18 | * |
||
| 19 | * @var string |
||
| 20 | */ |
||
| 21 | const IMAGE_PATH = 'denomination'; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * {@inheritDoc} |
||
| 25 | */ |
||
| 26 | protected $fillable = [ |
||
| 27 | 'name', |
||
| 28 | 'value', |
||
| 29 | 'type', |
||
| 30 | 'quantity_per_bundle', |
||
| 31 | 'minimum_order_bundle', |
||
| 32 | 'maximum_order_bundle', |
||
| 33 | 'image', |
||
| 34 | ]; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * {@inheritDoc} |
||
| 38 | */ |
||
| 39 | protected $casts = [ |
||
| 40 | 'value' => 'float', |
||
| 41 | 'type' => DenominationType::class, |
||
| 42 | 'quantity_per_bundle' => 'integer', |
||
| 43 | 'minimum_order_bundle' => 'integer', |
||
| 44 | 'maximum_order_bundle' => 'integer', |
||
| 45 | ]; |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Determine whether the given value is between the minimum and maximum order bundle. |
||
| 49 | * |
||
| 50 | * @param int $value |
||
| 51 | * @param bool $equal |
||
| 52 | * @return bool |
||
| 53 | */ |
||
| 54 | public function isBetweenOrderBundle(int $value, bool $equal = true): bool |
||
| 67 |