1 | <?php |
||
9 | class PlanInterval extends Model implements PlanIntervalContract |
||
10 | { |
||
11 | protected $table = 'plan_intervals'; |
||
12 | protected $fillable = [ |
||
13 | 'price', 'type', 'unit', |
||
14 | ]; |
||
15 | |||
16 | public static function make($type, int $unit, float $price): PlanIntervalContract |
||
28 | |||
29 | protected static function checkIfIntervalExists(string $interval) |
||
40 | |||
41 | public static function makeInfinite(float $price): PlanIntervalContract |
||
47 | |||
48 | public function plan() |
||
52 | |||
53 | public function getUnit(): int |
||
54 | { |
||
55 | return $this->unit; |
||
56 | } |
||
57 | |||
58 | public function isInfinite(): bool |
||
59 | { |
||
60 | return $this->getType() == null; |
||
61 | } |
||
62 | |||
63 | public function getType(): ?string |
||
64 | { |
||
65 | return $this->type; |
||
66 | } |
||
67 | |||
68 | public function isFree(): bool |
||
72 | |||
73 | public function getPrice(): float |
||
77 | |||
78 | public function isNotFree(): bool |
||
82 | } |
||
83 |