| Total Complexity | 2 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 11 | trait HasPurchaseParent |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @param IsPurchasableModelTrait $payment |
||
| 15 | * @return $this |
||
| 16 | */ |
||
| 17 | public function populateFromPayment($payment) |
||
| 18 | { |
||
| 19 | $this->{$this->getPurchaseFk()} = $payment->id; |
||
| 20 | $this->amount = floor($payment->getPurchaseAmount() * 100); |
||
|
|
|||
| 21 | $this->currency = $payment->getPurchaseCurrency(); |
||
| 22 | |||
| 23 | return $this; |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @return string |
||
| 28 | */ |
||
| 29 | protected function getPurchaseFk() |
||
| 32 | } |
||
| 33 | } |
||
| 34 |