[TYPO3-50-general] Generic Object Access

Karsten Dambekalns karsten at typo3.org
Tue Jan 6 12:43:18 CET 2009


Hi (Se-)Bastian.

On 06.01.2009 9:57 Uhr, Bastian Waidelich wrote:
> Some notes regarding the code:

Some were fixed already by Sebastian, I fixed the remaining ones plus 
some more nitpicking.

Please, mind the style changes I did as well in future commits. Thanks!

> - line 149:
> if (array_key_exists($property, get_class_vars(get_class($object)))) {
>
> Why don't you use get_object_vars here? Then you wouldn't have to
> convert the object to a class first.

One side effect is that get_class_vars() doesn't return "property names" 
on ArrayObject instances. With get_object_vars() does return the 
"property names", which leads to an error in the ObjectAccess class 
under certain circumstances. I changed this to get_object_vars(), moved 
some code around in get/setProperty to fix this error (and possible 
speed up things) and afterwards changed isPropertyAccessible() to work 
with ArrayObject instances as well.

Regards,
Karsten


More information about the TYPO3-project-5_0-general mailing list