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
Sql
LimitExpression.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\DB\Sql
;
7
11
class
LimitExpression
extends
Expression
12
{
16
protected
$sql
;
17
21
protected
$count
;
22
26
protected
$offset
;
27
33
public
function
__construct
(
34
$sql
,
35
$count
,
36
$offset
= 0
37
) {
38
$this->sql =
$sql
;
39
$this->count =
$count
;
40
$this->offset =
$offset
;
41
}
42
46
public
function
__toString
()
47
{
48
$sql
=
$this->sql
;
49
$count
= intval($this->count);
50
if
(
$count
<= 0) {
52
#require_once 'Zend/Db/Adapter/Exception.php';
53
throw
new \Zend_Db_Adapter_Exception(
"LIMIT argument count=$count is not valid"
);
54
}
55
56
$offset
= intval($this->offset);
57
if
(
$offset
< 0) {
59
#require_once 'Zend/Db/Adapter/Exception.php';
60
throw
new \Zend_Db_Adapter_Exception(
"LIMIT argument offset=$offset is not valid"
);
61
}
62
63
$sql
.=
" LIMIT $count"
;
64
if
(
$offset
> 0) {
65
$sql
.=
" OFFSET $offset"
;
66
}
67
return
trim(
$sql
);
68
}
69
}
Magento\Framework\DB\Sql\LimitExpression
Definition:
LimitExpression.php:11
Magento\Framework\DB\Sql
Definition:
ColumnValueExpression.php:6
Magento\Framework\DB\Sql\LimitExpression\__toString
__toString()
Definition:
LimitExpression.php:46
Magento\Framework\DB\Sql\LimitExpression\__construct
__construct( $sql, $count, $offset=0)
Definition:
LimitExpression.php:33
Magento\Framework\DB\Sql\LimitExpression\$offset
$offset
Definition:
LimitExpression.php:26
Magento\Framework\DB\Sql\LimitExpression\$count
$count
Definition:
LimitExpression.php:21
Magento\Framework\DB\Sql\LimitExpression\$sql
$sql
Definition:
LimitExpression.php:16
Magento\Framework\DB\Sql\Expression
Definition:
Expression.php:11