SilverStripe\GraphQL\Util\CaseInsensitiveFieldAccessor
Infer original field name casing from case insensitive field comparison.
Useful counterpart to .
SilverStripe is using a mix of case sensitive and case insensitive checks,
due to the nature of PHP (case sensitive for properties and array keys,
case insensitive for methods).
Caution: Assumes fields have been whitelisted through GraphQL type definitions already.
Does not perform any canView() checks or further validation.
Synopsis
class CaseInsensitiveFieldAccessor
implements
FieldAccessorInterface
{
- // constants
- const HAS_METHOD = 'HAS_METHOD';
- const HAS_FIELD = 'HAS_FIELD';
- const HAS_SETTER = 'HAS_SETTER';
- const DATAOBJECT = 'DATAOBJECT';
- // methods
- public mixed getValue()
- public mixed setValue()
- public null|string getObjectFieldName()
Hierarchy
Implements
Tasks
Line | Task |
---|---|
156 | Support for Object::$extra_methods (case sensitive array key check) |
Constants
Name | Value |
---|---|
HAS_METHOD | 'HAS_METHOD' |
HAS_FIELD | 'HAS_FIELD' |
HAS_SETTER | 'HAS_SETTER' |
DATAOBJECT | 'DATAOBJECT' |