コード例 #1
0
ファイル: Grid.php プロジェクト: aiesh/magento2
 /**
  * Prepare grid collection object
  *
  * @return $this
  */
 protected function _prepareCollection()
 {
     $collection = $this->_paymentCollection->create();
     $this->setCollection($collection);
     if (!$this->getParam($this->getVarNameSort())) {
         $collection->setOrder('payment_id', 'desc');
     }
     return parent::_prepareCollection();
 }
コード例 #2
0
ファイル: Success.php プロジェクト: aiesh/magento2
 /**
  * Prepare recurring payments from the session
  *
  * @return void
  */
 protected function _prepareLastRecurringPayments()
 {
     $paymentIds = $this->_checkoutSession->getLastRecurringPaymentIds();
     if ($paymentIds && is_array($paymentIds)) {
         $collection = $this->_recurringPaymentCollectionFactory->create()->addFieldToFilter('payment_id', array('in' => $paymentIds));
         $payments = array();
         foreach ($collection as $payment) {
             $payments[] = $payment;
         }
         if ($payments) {
             $this->setRecurringPayments($payments);
             if ($this->_customerSession->isLoggedIn()) {
                 $this->setCanViewPayments(true);
             }
         }
     }
 }