Skip to content
Projects
Groups
Snippets
Help
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project overview
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
271
Merge Requests
30
CI / CD
Security & Compliance
Packages
Wiki
Snippets
Members
Collapse sidebar
Close sidebar
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Backend - Engine
Commits
49e337f3
Commit
49e337f3
authored
36 minutes ago
by
Emiliano Balbuena
Browse files
Options
Download
(fix): Bring Response::sort() back
parent
09438dd6
goal/modal-pager
1 merge request
!433
WIP: Modal Page (+ FeedCollection)
Pipeline
#106216199
failed with stages
in 11 minutes and 36 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
Common/Repository/Response.php
View file @
49e337f3
...
...
@@ -384,6 +384,18 @@ class Response implements \Iterator, \ArrayAccess, \Countable, \JsonSerializable
return
array_reduce
(
$this
->
data
,
$callback
,
$initialValue
);
}
/**
* @param callable $callback
* @return Response
*/
public
function
sort
(
callable
$callback
)
:
Response
{
$data
=
$this
->
data
;
usort
(
$data
,
$callback
);
return
new
static
(
$data
,
$this
->
pagingToken
,
$this
->
attributes
);
}
/**
* Returns the first element of the Response, or null if empty
* @return mixed|null
...
...
This diff is collapsed.
Please
register
or
sign in
to comment