mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #9286 from jonom/patch-2
DOCS Note inability to filter on null
This commit is contained in:
commit
1d63cf50da
@ -321,6 +321,14 @@ exact match.
|
||||
'FirstName:StartsWith' => 'S'
|
||||
'PlayerNumber:GreaterThan' => '10'
|
||||
));
|
||||
|
||||
<div class="notice" markdown='1'>
|
||||
Please note that in SilverStripe 3.x it's not possible to filter a list based on a field containing a `null` value (see [this issue](https://github.com/silverstripe/silverstripe-framework/issues/3621) for context). You can workaround this with a `where` statement, for example:
|
||||
|
||||
:::php
|
||||
$unsponsoredPlayers = Player::get()->where("\"MainSponsor\" IS NULL OR \"MainSponsor\" = ''");
|
||||
|
||||
</div>
|
||||
|
||||
### filterAny
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user