$magicCall
$magicCall
Default implementation of {@link PropertyAccessorInterface}.
getValue(mixed $objectOrArray, mixed $propertyPath) : mixed
Returns the value at the end of the property path of the object graph.
mixed | $objectOrArray | The object or array to traverse |
mixed | $propertyPath | The property path to read |
The value at the end of the property path
setValue(mixed $objectOrArray, mixed $propertyPath, mixed $value) : mixed
Sets the value at the end of the property path of the object graph.
mixed | $objectOrArray | The object or array to modify |
mixed | $propertyPath | The property path to modify |
mixed | $value | The value to set at the end of the property path |
isReadable(mixed $objectOrArray, mixed $propertyPath) : bool
Returns whether a property path can be read from an object graph.
mixed | $objectOrArray | The object or array to check |
mixed | $propertyPath | The property path to check |
Whether the property path can be read
readPropertiesUntil(array $zval, \Symfony\Component\PropertyAccess\PropertyPathInterface $propertyPath, int $lastIndex, bool $ignoreInvalidIndices = true) : array
Reads the path from an object up to a given path index.
array | $zval | The array containing the object or array to read from |
\Symfony\Component\PropertyAccess\PropertyPathInterface | $propertyPath | The property path to read |
int | $lastIndex | The index up to which should be read |
bool | $ignoreInvalidIndices | Whether to ignore invalid indices or throw an exception |
if a value within the path is neither object nor array
If a non-existing index is accessed
The values read in the path
readIndex(array $zval, string|int $index) : array
Reads a key from an array-like structure.
array | $zval | The array containing the array or \ArrayAccess object to read from |
string|int | $index | The key to read |
If the array does not implement \ArrayAccess or it is not an array
The array containing the value of the key
readProperty(array $zval, string $property) : array
Reads the a property from an object.
array | $zval | The array containing the object to read from |
string | $property | The property to read |
if the property does not exist or is not public
The array containing the value of the property
writeIndex(array $zval, string|int $index, mixed $value) : mixed
Sets the value of an index in a given array-accessible value.
array | $zval | The array containing the array or \ArrayAccess object to write to |
string|int | $index | The index to write at |
mixed | $value | The value to write |
If the array does not implement \ArrayAccess or it is not an array
writeProperty(array $zval, string $property, mixed $value) : mixed
Sets the value of a property in the given object.
array | $zval | The array containing the object to write to |
string | $property | The property to write |
mixed | $value | The value to write |
if the property does not exist or is not public
writeCollection(array $zval, string $property, iterable $collection, string $addMethod, string $removeMethod) : mixed
Adjusts a collection-valued property by calling add*() and remove*() methods.
array | $zval | The array containing the object to write to |
string | $property | The property to write |
iterable | $collection | The collection to write |
string | $addMethod | The add*() method |
string | $removeMethod | The remove*() method |
findAdderAndRemover(\ReflectionClass $reflClass, array $singulars) : array|null
Searches for add and remove methods.
\ReflectionClass | $reflClass | The reflection class for the given object |
array | $singulars | The singular form of the property name or null |
An array containing the adder and remover when found, null otherwise
isMethodAccessible(\ReflectionClass $class, string $methodName, int $parameters) : bool
Returns whether a method is public and has the number of required parameters.
\ReflectionClass | $class | The class of the method |
string | $methodName | The method name |
int | $parameters | The number of parameters |
Whether the method is public and has $parameters required parameters