Source of file SubmissionPaymentFieldValue.php
Size: 0,845 Bytes - Last Modified: 2021-12-24T05:18:48+00:00
/var/www/docs.ssmods.com/process/src/src/Model/SubmissionPaymentFieldValue.php
12345678910111213141516171819202122232425262728293031323334353637383940 | <?php namespace IQnection\FormBuilderPayments\Model; use IQnection\FormBuilder\Model\SubmissionFieldValue; use IQnection\Payment\Payment; use SilverStripe\Forms; class SubmissionPaymentFieldValue extends SubmissionFieldValue { private static $table_name = 'FormBuilderSubmissionPaymentFieldValue'; private static $db = [ 'AdjustmentsLog' => 'Text', 'ChargeAmount' => 'Currency' ]; private static $has_one = [ 'Payment' => Payment::class ]; public function onAfterWrite() { parent::onAfterWrite(); if ($this->Payment()->Exists()) { $this->Payment()->PaidObjectID = $this->ID; $this->Payment()->PaidObjectType = $this->getClassName(); $this->Payment()->write(); } } public function DebugInfo() { return [ 'charge amount' => $this->ChargeAmount, 'data' => unserialize($this->AdjustmentsLog) ]; } } |