diff --git a/src/Util/CaseInsensitiveFieldAccessor.php b/src/Util/CaseInsensitiveFieldAccessor.php index 862fe465d..b62ae5562 100644 --- a/src/Util/CaseInsensitiveFieldAccessor.php +++ b/src/Util/CaseInsensitiveFieldAccessor.php @@ -122,8 +122,16 @@ public function setValue(ViewableData $object, $fieldName, $value, $opts = []) * Example: [ViewableDataCaseInsensitiveFieldMapper::HAS_METHOD => true] * @return null|string Name in actual casing on $object */ - protected function getObjectFieldName(ViewableData $object, $fieldName, $opts = []) + public function getObjectFieldName(ViewableData $object, $fieldName, $opts = []) { + $opts = $opts ?: []; + $opts = array_merge([ + self::HAS_METHOD => true, + self::HAS_FIELD => true, + self::HAS_SETTER => true, + self::DATAOBJECT => true, + ], $opts); + $optFn = function ($type) use (&$opts) { return (in_array($type, $opts) && $opts[$type] === true); };