コード例 #1
0
ファイル: Agreements.php プロジェクト: nja78/magento2
 /**
  * Retrieve billing agreements collection
  *
  * @return \Magento\Paypal\Model\Resource\Billing\Agreement\Collection
  */
 public function getBillingAgreements()
 {
     if ($this->_billingAgreements === null) {
         $this->_billingAgreements = $this->_agreementCollection->create()->addFieldToFilter('customer_id', $this->_customerSession->getCustomerId())->setOrder('agreement_id', 'desc');
     }
     return $this->_billingAgreements;
 }
コード例 #2
0
ファイル: Grid.php プロジェクト: nja78/magento2
 /**
  * Prepare collection for grid
  *
  * @return $this
  */
 protected function _prepareCollection()
 {
     /** @var \Magento\Paypal\Model\Resource\Billing\Agreement\Collection $collection */
     $collection = $this->_agreementFactory->create()->addCustomerDetails();
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }
コード例 #3
0
ファイル: Agreement.php プロジェクト: nja78/magento2
 /**
  * Retrieve available customer Billing Agreements
  *
  * @param int $customerId
  * @return \Magento\Paypal\Model\Resource\Billing\Agreement\Collection
  */
 public function getAvailableCustomerBillingAgreements($customerId)
 {
     $collection = $this->_billingAgreementFactory->create();
     $collection->addFieldToFilter('customer_id', $customerId)->addFieldToFilter('status', self::STATUS_ACTIVE)->setOrder('agreement_id');
     return $collection;
 }