Skip to content

Commit

Permalink
DOC DataList::sort() and orderBy()
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Dec 5, 2022
1 parent ef79863 commit 631b8bc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions en/04_Changelogs/5.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ This is a major release and as a result there are a number of breaking API chang

### ORM {#api-orm}

- [DataList::sort()](api:SilverStripe\ORM\DataList) No longer accepts raw SQL. A new method `DataList::orderBy()` has been created which accepts raw SQL, though it's recommended to continue using `DataList::sort()` if possible to reduce the chance of SQL injection vulnerabilities.
- Passing `null` to `DataList::sort()` i.e. `sort(null)` will now clear any existing sort values on a DataList. Passing an empty string i.e. `sort('')` or array i.e. `sort([])` will now cause an exception to be thrown.
- Prior to 5.0.0, when using `SQLSelect::setFrom()` or `SQLSelect::create('*', $from)` to set table or subselect definitions,
their aliases (applied by setting a string key for the array) were being ignored. This bug has been fixed - if you were working around this by manually setting the alias e.g. in a join, you can remove those workarounds now.
- [Query](api:SilverStripe\ORM\Connect\Query) now implements `IteratorAggregate` instead of `Iterator`. This means `seek()` and other iterator methods are no longer available on this class and its subclasses. Use `getIterator()` instead.
Expand Down

0 comments on commit 631b8bc

Please sign in to comment.