Source of file PaymentMessage.php
Size: 1,382 Bytes - Last Modified: 2021-12-24T06:34:53+00:00
/var/www/docs.ssmods.com/process/src/src/Model/Message/PaymentMessage.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 | <?php namespace SilverStripe\Omnipay\Model\Message; use SilverStripe\ORM\DataObject; use SilverStripe\Security\Security; use SilverStripe\Security\Member; use SilverStripe\Omnipay\Model\Payment; /** * Base class for logging messages, transactions etc associated with a payment. * @property string $Message * @property string $ClientIp * @property int $PaymentID * @property int $UserID * @method null|Payment Payment() * @method null|Member Member() */ class PaymentMessage extends DataObject { private static $db = [ 'Message' => 'Varchar(255)', 'ClientIp' => 'Varchar(39)' ]; private static $has_one = [ 'Payment' => Payment::class, 'User' => Member::class ]; private static $summary_fields = [ 'i18n_singular_name' => 'Type', 'Message' => 'Message', 'User.Name' => 'User' ]; private static $table_name = 'Omnipay_PaymentMessage'; public function getCMSFields() { return parent::getCMSFields()->makeReadOnly(); } public function onBeforeWrite() { parent::onBeforeWrite(); if (!$this->UserID && !$this->isInDB()) { if ($member = Security::getCurrentUser()) { $this->UserID = $member->ID; } } } public function getTitle() { return $this->i18n_singular_name(); } } |