File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -409,6 +409,42 @@ $specification = [
409409
410410If the ` id ` value given in the input is not an integer the Filterer::execute() will throw the ` NotFoundException `
411411
412+ ## returnOnNull
413+
414+ #### Summary
415+
416+ Flag to break the filter chain if a resulting value is ` null ` Useful for nullable fields which require additional filtering if the value is not null.
417+
418+ #### Types
419+
420+ * boolean
421+
422+ #### Default
423+
424+ The default value for this option is ` false `
425+
426+ #### Constant
427+
428+ ``` php
429+ TraderInteractive\FilterOptions::RETURN_ON_NULL
430+ ```
431+
432+ #### Example
433+
434+ ``` php
435+ $validCodes = ['A', 'I', 'X'];
436+ $specification = [
437+ 'code' => [
438+ \TraderInteractive\FilterOptions::RETURN_ON_NULL => true,
439+ ['string', true],
440+ ['strtoupper'],
441+ ['in', $validCodes],
442+ ],
443+ ];
444+ ```
445+
446+ If the ` code ` value is ` null ` then the resulting filtered value will be null. Otherwise the value must be one of the ` $validCode ` values.
447+
412448### Included Filters
413449Of course, any function can potentially be used as a filter, but we include some useful filters with aliases for common circumstances.
414450
You can’t perform that action at this time.
0 commit comments