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
Data
SearchResultIterator.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\Data
;
7
8
use
Magento\Framework\DB\QueryInterface
;
9
13
class
SearchResultIterator
implements
\Iterator
14
{
18
protected
$searchResult
;
19
23
protected
$query
;
24
28
protected
$current
;
29
33
protected
$key
= 0;
34
39
public
function
__construct
(
AbstractSearchResult
$searchResult
,
QueryInterface
$query
)
40
{
41
$this->searchResult =
$searchResult
;
42
$this->query =
$query
;
43
}
44
48
public
function
current
()
49
{
50
return
$this->current
;
51
}
52
56
public
function
next
()
57
{
58
++
$this->key
;
59
$this->
current
= $this->searchResult->createDataObject($this->query->fetchItem());
60
}
61
65
public
function
key
()
66
{
67
return
$this->key
;
68
}
69
73
public
function
valid
()
74
{
75
return
!empty($this->
current
);
76
}
77
81
public
function
rewind
()
82
{
83
$this->
current
=
null
;
84
$this->
key
= 0;
85
$this->query->reset();
86
$this->
next
();
87
}
88
}
Magento\Framework\Data\SearchResultIterator\$searchResult
$searchResult
Definition:
SearchResultIterator.php:18
Magento\Framework\Data\SearchResultIterator
Definition:
SearchResultIterator.php:13
Magento\Framework\Data\SearchResultIterator\$key
$key
Definition:
SearchResultIterator.php:33
Magento\Framework\Data
Definition:
AbstractCriteria.php:6
Magento\Framework\Data\SearchResultIterator\rewind
rewind()
Definition:
SearchResultIterator.php:81
Magento\Framework\Data\SearchResultIterator\$query
$query
Definition:
SearchResultIterator.php:23
Magento\Framework\DB\QueryInterface
Definition:
QueryInterface.php:11
Magento\Framework\Data\AbstractSearchResult
Definition:
AbstractSearchResult.php:11
Magento\Framework\Data\SearchResultIterator\key
key()
Definition:
SearchResultIterator.php:65
Magento\Framework\Data\SearchResultIterator\valid
valid()
Definition:
SearchResultIterator.php:73
Magento\Framework\Data\SearchResultIterator\next
next()
Definition:
SearchResultIterator.php:56
Magento\Framework\Data\SearchResultIterator\current
current()
Definition:
SearchResultIterator.php:48
Magento\Framework\Data\SearchResultIterator\__construct
__construct(AbstractSearchResult $searchResult, QueryInterface $query)
Definition:
SearchResultIterator.php:39
Magento\Framework\Data\SearchResultIterator\$current
$current
Definition:
SearchResultIterator.php:28