minor #10376 [Component][Serializer] Add fluent interface to GetSetMethodNormalizer (alexsegura)
This PR was merged into the 2.5-dev branch.
Discussion
----------
[Component][Serializer] Add fluent interface to GetSetMethodNormalizer
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | N/A
| License | MIT
| Doc PR | N/A
Commits
-------
2d42533
[Component][Serializer] Add fluent interface to GetSetMethodNormalizer
This commit is contained in:
commit
f15ea50b17
@ -46,6 +46,8 @@ class GetSetMethodNormalizer extends SerializerAwareNormalizer implements Normal
|
||||
* @param callable[] $callbacks help normalize the result
|
||||
*
|
||||
* @throws InvalidArgumentException if a non-callable callback is set
|
||||
*
|
||||
* @return GetSetMethodNormalizer
|
||||
*/
|
||||
public function setCallbacks(array $callbacks)
|
||||
{
|
||||
@ -55,26 +57,36 @@ class GetSetMethodNormalizer extends SerializerAwareNormalizer implements Normal
|
||||
}
|
||||
}
|
||||
$this->callbacks = $callbacks;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set ignored attributes for normalization
|
||||
*
|
||||
* @param array $ignoredAttributes
|
||||
*
|
||||
* @return GetSetMethodNormalizer
|
||||
*/
|
||||
public function setIgnoredAttributes(array $ignoredAttributes)
|
||||
{
|
||||
$this->ignoredAttributes = $ignoredAttributes;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set attributes to be camelized on denormalize
|
||||
*
|
||||
* @param array $camelizedAttributes
|
||||
*
|
||||
* @return GetSetMethodNormalizer
|
||||
*/
|
||||
public function setCamelizedAttributes(array $camelizedAttributes)
|
||||
{
|
||||
$this->camelizedAttributes = $camelizedAttributes;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user