Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields
SearchCriteria Class Reference
Inheritance diagram for SearchCriteria:
AbstractSimpleObject SearchCriteriaInterface SearchCriteria

Public Member Functions

 getFilterGroups ()
 
 getSortOrders ()
 
 getPageSize ()
 
 getCurrentPage ()
 
 setFilterGroups (array $filterGroups=null)
 
 setSortOrders (array $sortOrders=null)
 
 setPageSize ($pageSize)
 
 setCurrentPage ($currentPage)
 
- Public Member Functions inherited from AbstractSimpleObject
 __construct (array $data=[])
 
 setData ($key, $value)
 
 __toArray ()
 

Data Fields

const FILTER_GROUPS = 'filter_groups'
 
const SORT_ORDERS = 'sort_orders'
 
const PAGE_SIZE = 'page_size'
 
const CURRENT_PAGE = 'current_page'
 

Additional Inherited Members

- Protected Member Functions inherited from AbstractSimpleObject
 _get ($key)
 
- Protected Attributes inherited from AbstractSimpleObject
 $_data
 

Detailed Description

Data Object for SearchCriteria @codeCoverageIgnore

Definition at line 13 of file SearchCriteria.php.

Member Function Documentation

◆ getCurrentPage()

getCurrentPage ( )

Get current page.

Returns
int|null

Implements SearchCriteriaInterface.

Definition at line 59 of file SearchCriteria.php.

60  {
61  return $this->_get(self::CURRENT_PAGE);
62  }

◆ getFilterGroups()

getFilterGroups ( )

Get a list of filter groups.

Returns
\Magento\Framework\Api\Search\FilterGroup[]

Implements SearchCriteriaInterface.

Definition at line 28 of file SearchCriteria.php.

29  {
30  $filterGroups = $this->_get(self::FILTER_GROUPS);
31  return is_array($filterGroups) ? $filterGroups : [];
32  }

◆ getPageSize()

getPageSize ( )

Get page size.

Returns
int|null

Implements SearchCriteriaInterface.

Definition at line 49 of file SearchCriteria.php.

50  {
51  return $this->_get(self::PAGE_SIZE);
52  }

◆ getSortOrders()

getSortOrders ( )

Get sort order.

Returns
\Magento\Framework\Api\SortOrder[]|null

Implements SearchCriteriaInterface.

Definition at line 39 of file SearchCriteria.php.

40  {
41  return $this->_get(self::SORT_ORDERS);
42  }

◆ setCurrentPage()

setCurrentPage (   $currentPage)

Set current page.

Parameters
int$currentPage
Returns
$this

Implements SearchCriteriaInterface.

Definition at line 103 of file SearchCriteria.php.

104  {
105  return $this->setData(self::CURRENT_PAGE, $currentPage);
106  }

◆ setFilterGroups()

setFilterGroups ( array  $filterGroups = null)

Set a list of filter groups.

Parameters

Implements SearchCriteriaInterface.

Definition at line 70 of file SearchCriteria.php.

71  {
72  return $this->setData(self::FILTER_GROUPS, $filterGroups);
73  }

◆ setPageSize()

setPageSize (   $pageSize)

Set page size.

Parameters
int$pageSize
Returns
$this

Implements SearchCriteriaInterface.

Definition at line 92 of file SearchCriteria.php.

93  {
94  return $this->setData(self::PAGE_SIZE, $pageSize);
95  }

◆ setSortOrders()

setSortOrders ( array  $sortOrders = null)

Set sort order.

Parameters

Implements SearchCriteriaInterface.

Definition at line 81 of file SearchCriteria.php.

82  {
83  return $this->setData(self::SORT_ORDERS, $sortOrders);
84  }

Field Documentation

◆ CURRENT_PAGE

const CURRENT_PAGE = 'current_page'

Definition at line 21 of file SearchCriteria.php.

◆ FILTER_GROUPS

const FILTER_GROUPS = 'filter_groups'

#+ Constants for Data Object keys

Definition at line 18 of file SearchCriteria.php.

◆ PAGE_SIZE

const PAGE_SIZE = 'page_size'

Definition at line 20 of file SearchCriteria.php.

◆ SORT_ORDERS

const SORT_ORDERS = 'sort_orders'

Definition at line 19 of file SearchCriteria.php.


The documentation for this class was generated from the following file: