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
framework
DB
SubSelect.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\DB
;
7
8
use
Magento\Framework\App\ResourceConnection
;
9
use
Magento\Framework\DB\Adapter\AdapterInterface
;
10
14
class
SubSelect
extends
\Zend_Db_Expr
15
{
19
protected
$table
;
20
24
protected
$columns
;
25
29
protected
$originColumn
;
30
34
protected
$targetColumn
;
35
39
protected
$resource
;
40
44
protected
$connectionName
;
45
49
protected
$connection
;
50
59
public
function
__construct
(
60
ResourceConnection
$resource
,
61
$table
,
62
array
$columns
,
63
$originColumn
,
64
$targetColumn
,
65
$connectionName
=
ResourceConnection::DEFAULT_CONNECTION
66
) {
67
$this->resource =
$resource
;
68
$this->connectionName =
$connectionName
;
69
$this->table =
$table
;
70
$this->columns =
$columns
;
71
$this->originColumn =
$originColumn
;
72
$this->targetColumn =
$targetColumn
;
73
}
74
78
public
function
__toString
()
79
{
80
$select
= $this->
getConnection
()->select()->from(
81
$this->resource->getTableName($this->table),
82
array_values($this->columns)
83
)->where(
84
sprintf(
85
'%s = %s'
,
86
$this->
getConnection
()->quoteIdentifier($this->originColumn),
87
$this->
getConnection
()->quoteIdentifier($this->targetColumn)
88
)
89
)->limit(1);
90
return
sprintf(
'(%s)'
,
$select
);
91
}
92
98
protected
function
getConnection
()
99
{
100
if
(!$this->connection) {
101
$this->connection = $this->resource->getConnection($this->connectionName);
102
}
103
return
$this->connection
;
104
}
105
}
Magento\Framework\DB\SubSelect\$connection
$connection
Definition:
SubSelect.php:49
Magento\Framework\DB\SubSelect\__toString
__toString()
Definition:
SubSelect.php:78
Magento\Framework\DB\SubSelect
Definition:
SubSelect.php:14
Magento\Framework\DB\SubSelect\__construct
__construct(ResourceConnection $resource, $table, array $columns, $originColumn, $targetColumn, $connectionName=ResourceConnection::DEFAULT_CONNECTION)
Definition:
SubSelect.php:59
Zend_Db_Expr
Definition:
Expr.php:49
$select
$select
Definition:
catalog_rule_10_off_not_logged_rollback.php:14
Magento\Framework\DB\SubSelect\$targetColumn
$targetColumn
Definition:
SubSelect.php:34
Magento\Framework\DB
Definition:
AbstractMapper.php:6
Magento\Framework\DB\SubSelect\$table
$table
Definition:
SubSelect.php:19
Magento\Framework\App\ResourceConnection\DEFAULT_CONNECTION
const DEFAULT_CONNECTION
Definition:
ResourceConnection.php:26
Magento\Framework\DB\Adapter\AdapterInterface
Definition:
AdapterInterface.php:16
Magento\Framework\DB\SubSelect\$columns
$columns
Definition:
SubSelect.php:24
Magento\Framework\App\ResourceConnection
Definition:
ResourceConnection.php:18
Magento\Framework\DB\SubSelect\$connectionName
$connectionName
Definition:
SubSelect.php:44
Magento\Framework\DB\SubSelect\$originColumn
$originColumn
Definition:
SubSelect.php:29
Magento\Framework\DB\SubSelect\getConnection
getConnection()
Definition:
SubSelect.php:98
Magento\Framework\App\ResourceConnection
Magento\Framework\DB\SubSelect\$resource
$resource
Definition:
SubSelect.php:39