You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// operations functions are both setters and getters. When setting, the funciton returns the $path object for chainability
75
75
$search->_and('balloon');
76
-
$path->search($search);
76
+
$path->setSearch($search);
77
77
```
78
78
This will now search the set of Employees objects to be returned for '"mountain bike" AND balloon'. See the Expand section below to learn how the search function can be applied to specific properties.
79
79
80
80
<h3>$count</h3>
81
81
82
82
You can return the total record count of your query. The $count system query option ignores any $top, $skip, or $expand query options, and returns the total count of results across all pages including only those results matching any specified $filter and $search. Clients should be aware that the count returned inline may not exactly equal the actual number of items returned, due to latency between calculating the count and enumerating the last value or due to inexact calculations on the service.
83
83
```PHP
84
-
$path->count();
85
-
$path->count(FALSE); // Disables $count
84
+
$path->getCount();
85
+
$path->setCount(FALSE); // Disables $count
86
86
```
87
87
<h3>$filter</h3>
88
88
89
89
The recordset queried can be filtered to return a more precise set of records. There are various filters available and most can be used in combination with another.
90
90
```PHP
91
91
$filter = new ODataGreaterThanEqualsFilter('YearsEmployed', 6); // YearsEmployed ge 6
92
-
$path->filter($filter);
92
+
$path->setFilter($filter);
93
93
```
94
94
Each filter has a set of extensible functions that allow the filter to be passed into another filter, returning the new filter.
95
95
```PHP
96
96
$add_filter = new ODataAddFilter('YearsEmployed', 5); // YearsEmployed add 5
97
97
$filter = $add_filter->greaterThanEquals(6); // YearsEmployed add 5 ge 6
98
-
$path->filter($filter);
98
+
$path->setFilter($filter);
99
99
```
100
100
Filters can accept Filters as properties or values and a value can also be a property name
101
101
```PHP
102
102
$sub_filter = new ODataSubtractFilter('YearsEmployed', 'YearsSebatical'); // YearsEmployed sub YearsSebatical
103
103
$sub_filter2 = new ODataAddFilter('Awards', 'Demotions'); // Awards sub Demotions
104
104
$filter = $sub_filter->greaterThan($sub_filter2); // (YearsEmployed sub YearsSebatical) gt (Awards sub Demotions)
105
-
$path->filter($filter);
105
+
$path->setFilter($filter);
106
106
```
107
107
<h3>$pager</h3>
108
108
109
109
Records can be paged server-side by passing $top and $skip where $top is the limit of records returned and $skip is the start offset. The ODataQueryPager object takes the math out of the equation and lets you simply specify the limit and the page you want to return.
110
110
```PHP
111
111
$pager = new ODataQueryPager(20, 5); // $top=20&$skip=100
112
-
$path->pager($pager);
112
+
$path->setPager($pager);
113
113
```
114
114
115
115
<h3>$orderby</h3>
116
116
117
117
Results can be sorted by a property name within the collection. Simply specify which property you would like to sort by in the orderBy() function.
$expand2 = new \ODataQuery\Expand\ODataQueryExpand("SubProperty", new \ODataQuery\Filter\Operators\Logical\ODataLessThanOperator("SubSubProperty", 4));
0 commit comments