Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-paypal
Model
ResourceModel
Billing
Agreement.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Paypal\Model\ResourceModel\Billing
;
7
11
class
Agreement
extends
\Magento\Framework\Model\ResourceModel\Db\AbstractDb
12
{
18
protected
function
_construct
()
19
{
20
$this->
_init
(
'paypal_billing_agreement'
,
'agreement_id'
);
21
}
22
30
public
function
addOrderRelation
($agreementId, $orderId)
31
{
32
$this->
getConnection
()->insert(
33
$this->
getTable
(
'paypal_billing_agreement_order'
),
34
[
'agreement_id'
=> $agreementId,
'order_id'
=> $orderId]
35
);
36
return
$this;
37
}
38
46
public
function
addOrdersFilter
(\
Magento
\Framework\
Data
\
Collection
\
AbstractDb
$orderCollection
, $agreementIds)
47
{
48
$agreementIds = is_array($agreementIds) ? $agreementIds : [$agreementIds];
49
$orderIds
= $this->
getConnection
()->fetchCol(
50
$this->
getConnection
()->select()
51
->from([
'pbao'
=> $this->
getTable
(
'paypal_billing_agreement_order'
)], [
'order_id'
])
52
->where(
53
'pbao.agreement_id IN(?)'
,
54
$agreementIds
55
)
56
);
57
$orderCollection
->getSelect()
58
->where(
'main_table.entity_id IN (?)'
,
$orderIds
);
59
return
$this;
60
}
61
}
Magento\Framework\Model\ResourceModel\Db\AbstractDb\_init
_init($mainTable, $idFieldName)
Definition:
AbstractDb.php:186
Magento\Framework\Data\Collection\AbstractDb
Definition:
AbstractDb.php:23
Magento\Paypal\Model\ResourceModel\Billing\Agreement
Definition:
Agreement.php:11
Magento\Paypal\Model\ResourceModel\Billing
Magento\Config\Model\Config\Structure\Data
Definition:
Data.php:15
Magento\Paypal\Model\ResourceModel\Billing\Agreement\addOrderRelation
addOrderRelation($agreementId, $orderId)
Definition:
Agreement.php:30
Magento\Framework\Model\ResourceModel\Db\AbstractDb\getTable
getTable($tableName)
Definition:
AbstractDb.php:279
Magento
Magento\Framework\Model\ResourceModel\Db\AbstractDb
Definition:
AbstractDb.php:24
Magento\Paypal\Model\ResourceModel\Billing\Agreement\_construct
_construct()
Definition:
Agreement.php:18
Magento\Framework\Data\Collection
Definition:
Collection.php:19
$orderIds
$orderIds
Definition:
results.phtml:9
$orderCollection
$orderCollection
Definition:
creditmemo_items_for_search.php:19
Magento\Framework\Model\ResourceModel\Db\AbstractDb\getConnection
getConnection()
Definition:
AbstractDb.php:325
Magento\Paypal\Model\ResourceModel\Billing\Agreement\addOrdersFilter
addOrdersFilter(\Magento\Framework\Data\Collection\AbstractDb $orderCollection, $agreementIds)
Definition:
Agreement.php:46