Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Member Functions
Row Class Reference
Inheritance diagram for Row:
AbstractModel DataObject

Public Member Functions

 getReferenceType ($code)
 
 getTransactionEvent ($code)
 
 getDebitCreditText ($code)
 
 getCastedAmount ($key)
 
 getTransactionEvents ()
 
- Public Member Functions inherited from AbstractModel
 __construct (\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])
 
 __sleep ()
 
 __wakeup ()
 
 setIdFieldName ($name)
 
 getIdFieldName ()
 
 getId ()
 
 setId ($value)
 
 isDeleted ($isDeleted=null)
 
 hasDataChanges ()
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 setDataChanges ($value)
 
 getOrigData ($key=null)
 
 setOrigData ($key=null, $data=null)
 
 dataHasChangedFor ($field)
 
 getResourceName ()
 
 getResourceCollection ()
 
 getCollection ()
 
 load ($modelId, $field=null)
 
 beforeLoad ($identifier, $field=null)
 
 afterLoad ()
 
 isSaveAllowed ()
 
 setHasDataChanges ($flag)
 
 save ()
 
 afterCommitCallback ()
 
 isObjectNew ($flag=null)
 
 beforeSave ()
 
 validateBeforeSave ()
 
 getCacheTags ()
 
 cleanModelCache ()
 
 afterSave ()
 
 delete ()
 
 beforeDelete ()
 
 afterDelete ()
 
 afterDeleteCommit ()
 
 getResource ()
 
 getEntityId ()
 
 setEntityId ($entityId)
 
 clearInstance ()
 
 getStoredData ()
 
 getEventPrefix ()
 
- Public Member Functions inherited from DataObject
 __construct (array $data=[])
 
 addData (array $arr)
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 getData ($key='', $index=null)
 
 getDataByPath ($path)
 
 getDataByKey ($key)
 
 setDataUsingMethod ($key, $args=[])
 
 getDataUsingMethod ($key, $args=null)
 
 hasData ($key='')
 
 toArray (array $keys=[])
 
 convertToArray (array $keys=[])
 
 toXml (array $keys=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 convertToXml (array $arrAttributes=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 toJson (array $keys=[])
 
 convertToJson (array $keys=[])
 
 toString ($format='')
 
 __call ($method, $args)
 
 isEmpty ()
 
 serialize ($keys=[], $valueSeparator='=', $fieldSeparator=' ', $quote='"')
 
 debug ($data=null, &$objects=[])
 
 offsetSet ($offset, $value)
 
 offsetExists ($offset)
 
 offsetUnset ($offset)
 
 offsetGet ($offset)
 

Protected Member Functions

 _construct ()
 
- Protected Member Functions inherited from AbstractModel
 _construct ()
 
 _init ($resourceModel)
 
 _setResourceModel ($resourceName, $collectionName=null)
 
 _getResource ()
 
 _getEventData ()
 
 _beforeLoad ($modelId, $field=null)
 
 _afterLoad ()
 
 _hasModelChanged ()
 
 _getValidatorBeforeSave ()
 
 _createValidatorBeforeSave ()
 
 _getValidationRulesBeforeSave ()
 
 _clearReferences ()
 
 _clearData ()
 
- Protected Member Functions inherited from DataObject
 _getData ($key)
 
 _underscore ($name)
 

Additional Inherited Members

- Protected Attributes inherited from AbstractModel
 $_eventPrefix = 'core_abstract'
 
 $_eventObject = 'object'
 
 $_idFieldName = 'id'
 
 $_hasDataChanges = false
 
 $_origData
 
 $_isDeleted = false
 
 $_resource
 
 $_resourceCollection
 
 $_resourceName
 
 $_collectionName
 
 $_cacheTag = false
 
 $_dataSaveAllowed = true
 
 $_isObjectNew = null
 
 $_validatorBeforeSave = null
 
 $_eventManager
 
 $_cacheManager
 
 $_registry
 
 $_logger
 
 $_appState
 
 $_actionValidator
 
 $storedData = []
 
- Protected Attributes inherited from DataObject
 $_data = []
 
- Static Protected Attributes inherited from DataObject
static $_underscoreCache = []
 

Detailed Description

Model for report rows @method int getReportId() @method Row setReportId(int $value) @method string getTransactionId() @method Row setTransactionId(string $value) @method string getInvoiceId() @method Row setInvoiceId(string $value) @method string getPaypalReferenceId() @method Row setPaypalReferenceId(string $value) @method string getPaypalReferenceIdType() @method Row setPaypalReferenceIdType(string $value) @method string getTransactionEventCode() @method Row setTransactionEventCode(string $value) @method string getTransactionInitiationDate() @method Row setTransactionInitiationDate(string $value) @method string getTransactionCompletionDate() @method Row setTransactionCompletionDate(string $value) @method string getTransactionDebitOrCredit() @method Row setTransactionDebitOrCredit(string $value) @method float getGrossTransactionAmount() @method Row setGrossTransactionAmount(float $value) @method string getGrossTransactionCurrency() @method Row setGrossTransactionCurrency(string $value) @method string getFeeDebitOrCredit() @method Row setFeeDebitOrCredit(string $value) @method float getFeeAmount() @method Row setFeeAmount(float $value) @method string getFeeCurrency() @method Row setFeeCurrency(string $value) @method string getCustomField() @method Row setCustomField(string $value) @method string getConsumerId() @method Row setConsumerId(string $value)

Author
Magento Core Team core@.nosp@m.mage.nosp@m.ntoco.nosp@m.mmer.nosp@m.ce.co.nosp@m.m

Definition at line 45 of file Row.php.

Member Function Documentation

◆ _construct()

_construct ( )
protected

Initialize resource model

Returns
void

Definition at line 69 of file Row.php.

70  {
71  $this->_init(\Magento\Paypal\Model\ResourceModel\Report\Settlement\Row::class);
72  }

◆ getCastedAmount()

getCastedAmount (   $key)

Cast amounts of the specified keys

If the "credit" value is detected, it will be casted to negative amount

Parameters
string$key
Returns
float|null

Definition at line 126 of file Row.php.

127  {
128  if (empty($this->castAmountRelation[$key])) {
129  return null;
130  }
131  if (empty($this->_data[$key]) || empty($this->_data[$this->castAmountRelation[$key]])) {
132  return null;
133  }
134 
135  $amount = $this->_data[$key];
136  if ('CR' == $this->_data[$this->castAmountRelation[$key]]) {
137  $amount = -1 * $amount;
138  }
139  return $amount;
140  }
$amount
Definition: order.php:14

◆ getDebitCreditText()

getDebitCreditText (   $code)

Return description of "Debit or Credit" value

Parameters
string$code
Returns
string

Definition at line 111 of file Row.php.

112  {
113  $options = ['CR' => __('Credit'), 'DR' => __('Debit')];
114 
115  return !empty($options[$code]) ? $options[$code] : $code;
116  }
__()
Definition: __.php:13
$code
Definition: info.phtml:12

◆ getReferenceType()

getReferenceType (   $code)

Return description of Reference ID Type If no code specified, return full list of codes with their description

Parameters
string$code
Returns
string

Definition at line 81 of file Row.php.

82  {
83  $types = [
84  'ODR' => __('Order ID'),
85  'PAP' => __('Preapproved Payment ID'),
86  'TXN' => __('Transaction ID'),
87  'SUB' => __('Subscription ID'),
88  ];
89  return !empty($types[$code]) ? $types[$code] : $code;
90  }
__()
Definition: __.php:13
$code
Definition: info.phtml:12

◆ getTransactionEvent()

getTransactionEvent (   $code)

Get native description for transaction code

Parameters
string$code
Returns
string

Definition at line 98 of file Row.php.

99  {
100  $events = $this->getTransactionEvents();
101 
102  return !empty($events[$code]) ? $events[$code] : $code;
103  }
$code
Definition: info.phtml:12

◆ getTransactionEvents()

getTransactionEvents ( )

Get full list of codes with their description

Returns
array

Definition at line 147 of file Row.php.

148  {
149  if (empty($this->eventLabelsList)) {
150  $this->eventLabelsList = [
151  'T1502' => __('ACH Deposit (Hold for Dispute or Other Investigation)'),
152  'T1104' => __('ACH Deposit (Reversal)'),
153  'T0302' => __('ACH Funding for Funds Recovery from Account Balance'),
154  'T1101' => __('ACH Withdrawal'),
155  'T1106' => __('Account-to-Account Payment, initiated by PayPal'),
156  'T0010' => __('Auction Payment other than through eBay'),
157  'T0401' => __('AutoSweep'),
158  'T1503' => __('Available Balance'),
159  'T0803' => __('Balance Manager Account Bonus'),
160  'T0806' => __('Bonus for first ACH Use'),
161  'T1800' => __('Buyer Credit Payment'),
162  'T1203' => __('Charge-off'),
163  'T1201' => __('Chargeback'),
164  'T0903' => __('Coupon Redemption'),
165  'T0202' => __('Currency Conversion required to cover negative balance'),
166  'T0801' => __('Debit Card Cash Back'),
167  'T1102' => __('Debit Card Transaction'),
168  'T0005' => __('Direct Payment API'),
169  'T0303' => __('EFT Funding (German banking)'),
170  'T0006' => __('Express Checkout APIs'),
171  'T1108' => __('Fee Reversal'),
172  'T0102' => __('Fee: Foreign ACH Withdrawal'),
173  'T0104' => __('Fee: Mass Pay Request'),
174  'T0101' => __('Fee: Web Site Payments Pro Account Monthly'),
175  'T0103' => __('Fee: WorldLink Check Withdrawal'),
176  'T1600' => __('Funding'),
177  'T1300' => __('General (Authorization)'),
178  'T1400' => __('General (Dividend)'),
179  'T2000' => __('General (Funds Transfer from PayPal Account to Another)'),
180  'T0700' => __('General (Purchase with a credit card)'),
181  'T1900' => __('General Adjustment without businessrelated event'),
182  'T0200' => __('General Currency Conversion'),
183  'T0300' => __('General Funding of PayPal Account '),
184  'T0900' => __('General Redemption'),
185  'T0400' => __('General Withdrawal from PayPal Account'),
186  'T1000' => __('General. Product no longer supported'),
187  'T0500' => __('General: Use of PayPal account for purchasing as well as receiving payments'),
188  'T0600' => __('General: Withdrawal from PayPal Account'),
189  'T1700' => __('General: Withdrawal to Non-Bank Entity'),
190  'T1200' => __('General: adjustment of a type not belonging to the other T12xx categories'),
191  'T0800' => __('General: bonus of a type not belonging to the other T08xx categories'),
192  'T9900' => __('General: event not yet categorized'),
193  'T0100' => __('General: non-payment fee of a type not belonging to the other T01xx categories'),
194  'T0000' => __('General: received payment of a type not belonging to the other T00xx categories'),
195  'T1100' => __('General: reversal of a type not belonging to the other T11xx categories'),
196  'T1500' => __('General: temporary hold of a type not belonging to the other T15xx categories'),
197  'T0009' => __('Gift Certificate Payment: purchase of Gift Certificate'),
198  'T0901' => __('Gift Certificate Redemption'),
199  'T0503' => __('Hidden Virtual PayPal Debit Card Transaction'),
200  'T1110' => __('Hold for Dispute Investigation'),
201  'T1204' => __('Incentive'),
202  'T0001' => __('Mass Pay Payment'),
203  'T0802' => __('Merchant Referral Bonus'),
204  'T0011' => __('Mobile Payment (made via a mobile phone)'),
205  'T0701' => __('Negative Balance'),
206  'T1501' => __('Open Authorization'),
207  'T0301' => __('PayPal Balance Manager function of PayPal account'),
208  'T0804' => __('PayPal Buyer Warranty Bonus'),
209  'T0504' => __('PayPal Debit Card Cash Advance'),
210  'T0502' => __('PayPal Debit Card Withdrawal from ATM'),
211  'T0805' => __('PayPal Protection Bonus'),
212  'T1107' => __('Payment Refund initiated by merchant'),
213  'T0902' => __('Points Incentive Redemption'),
214  'T0008' => __('Postage Payment to either USPS or UPS'),
215  'T0003' => __('Preapproved Payment (BillUser API, either sent or received'),
216  'T1301' => __('Reauthorization'),
217  'T1205' => __('Reimbursement of Chargeback'),
218  'T1202' => __('Reversal'),
219  'T1105' => __('Reversal of General Account Hold'),
220  'T1103' => __('Reversal of Points Usage'),
221  'T1111' => __('Reversal of hold for Dispute Investigation'),
222  'T0904' => __('Reward Voucher Redemption'),
223  'T2001' => __('Settlement Consolidation'),
224  'T0002' => __('Subscription Payment, either payment sent or payment received'),
225  'T0201' => __('User-initiated Currency Conversion'),
226  'T0501' => __('Virtual PayPal Debit Card Transaction'),
227  'T0012' => __('Virtual Terminal Payment'),
228  'T1302' => __('Void'),
229  'T1701' => __('WorldLink Withdrawal'),
230  'T0004' => __('eBay Auction Payment'),
231  ];
232  }
233 
234  return $this->eventLabelsList;
235  }
__()
Definition: __.php:13

The documentation for this class was generated from the following file: