| @@ 36-49 (lines=14) @@ | ||
| 33 | } |
|
| 34 | ||
| 35 | /** {@inheritdoc} */ |
|
| 36 | public function getQuantityOptions() |
|
| 37 | { |
|
| 38 | $result = []; |
|
| 39 | foreach ([1, 3, 6, 12] as $n) { |
|
| 40 | $date = (new DateTime())->add(new \DateInterval("P{$n}M")); |
|
| 41 | ||
| 42 | $result[$n] = Yii::t('hipanel/server', '{n, plural, one{# month} other{# months}} till {date}', [ |
|
| 43 | 'n' => $n, |
|
| 44 | 'date' => Yii::$app->formatter->asDate($date), |
|
| 45 | ]); |
|
| 46 | } |
|
| 47 | ||
| 48 | return $result; |
|
| 49 | } |
|
| 50 | } |
|
| 51 | ||
| @@ 72-85 (lines=14) @@ | ||
| 69 | } |
|
| 70 | ||
| 71 | /** {@inheritdoc} */ |
|
| 72 | public function getQuantityOptions() |
|
| 73 | { |
|
| 74 | $result = []; |
|
| 75 | foreach ([1, 3, 6, 12] as $n) { |
|
| 76 | $date = (new DateTime($this->_model->expires))->add(new \DateInterval("P{$n}M")); |
|
| 77 | ||
| 78 | $result[$n] = Yii::t('hipanel/server', '{n, plural, one{# month} other{# months}} till {date}', [ |
|
| 79 | 'n' => $n, |
|
| 80 | 'date' => Yii::$app->formatter->asDate($date), |
|
| 81 | ]); |
|
| 82 | } |
|
| 83 | ||
| 84 | return $result; |
|
| 85 | } |
|
| 86 | ||
| 87 | /** {@inheritdoc} */ |
|
| 88 | public function getPurchaseModel($options = []) |
|