Skip to content

Commit

Permalink
Add ability to chain ERXSortOrderings in addition to ERXSortOrdering
Browse files Browse the repository at this point in the history
  • Loading branch information
avendasora authored and Pascal Robert committed May 1, 2012
1 parent 5b9e8d4 commit 65a54e2
Showing 1 changed file with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,20 @@ public ERXSortOrderings then(EOSortOrdering nextSortOrdering) {
return sortOrderings;
}

/**
* Returns ERXSortOrderings with this sort ordering followed by the provided
* array of next sort orderings.
*
* @param nextSortOrderings
* the next sort orderings to chain to this
* @return an array of sort orderings
* @author David Avendasora
*/
public ERXSortOrderings then(NSArray<EOSortOrdering> nextSortOrderings) {
array().insertObjectAtIndex(this, 0);
return array();
}

/**
* Returns this sort ordering as an array.
*
Expand Down Expand Up @@ -202,6 +216,19 @@ public ERXSortOrderings then(EOSortOrdering nextSortOrdering) {
return this;
}

/**
* Adds the given sort orderings to the end of this list and returns
* "this" so it can be chained again.
*
* @param nextSortOrderings the sort ordering to add
* @return this (with the sort orderings appended)
* @author David Avendasora
*/
public ERXSortOrderings then(ERXSortOrderings nextSortOrderings) {
addObjectsFromArray(nextSortOrderings);
return this;
}

/**
* Returns an array sorted with this sort ordering.
*
Expand Down

1 comment on commit 65a54e2

@avendasora
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uhg. There is a bug in this commit! Lines 83-84 make no sense whatsoever. Please see new pull request #169 #169

Please sign in to comment.