mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
DOCS Note inability to filter on null
This commit is contained in:
parent
837507e63b
commit
48d3d9ca49
@ -321,6 +321,14 @@ exact match.
|
|||||||
'FirstName:StartsWith' => 'S'
|
'FirstName:StartsWith' => 'S'
|
||||||
'PlayerNumber:GreaterThan' => '10'
|
'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
|
### filterAny
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user