Is there an existing issue for this?
Current Behavior
With a class containing the follow properties
#[ORM\ManyToOne]
#[ORM\JoinColumn(nullable: true)]
public ?Identity $identity = null;
#[ORM\ManyToOne(inversedBy: 'people')]
#[ORM\JoinColumn(nullable: false)]
public Network $network;
only the property $identity is returned in get_object_vars($subject)
https://github.com/neos/flow-development-collection/blob/9.2/Neos.Utility.ObjectHandling/Classes/ObjectAccess.php#L194-L196
This means, that validation is breaking, as the validator can't access non-initialized properties.
This is intended behavior of that function described in the note on php.net
https://www.php.net/manual/en/function.get-object-vars.php
Expected Behavior
All public properties should be seen by the ObjectAccess.
Solvable with ReflectionClass
Changing this to using the ReflectionClass functionality we can get all public properties
$properties = array_map(fn(\ReflectionProperty $property) => $property->getName(), (new \ReflectionClass($subject))->getProperties(\ReflectionProperty::IS_PUBLIC));
if (in_array($propertyName, $properties)) {
self::$propertyGetterCache[$cacheIdentifier]['publicProperty'] = $propertyName;
}
Steps To Reproduce
No response
Environment
Anything else?
No response
Is there an existing issue for this?
Current Behavior
With a class containing the follow properties
only the property
$identityis returned inget_object_vars($subject)https://github.com/neos/flow-development-collection/blob/9.2/Neos.Utility.ObjectHandling/Classes/ObjectAccess.php#L194-L196
This means, that validation is breaking, as the validator can't access non-initialized properties.
This is intended behavior of that function described in the note on php.net
https://www.php.net/manual/en/function.get-object-vars.php
Expected Behavior
All public properties should be seen by the ObjectAccess.
Solvable with ReflectionClass
Changing this to using the ReflectionClass functionality we can get all public properties
Steps To Reproduce
No response
Environment
Anything else?
No response