Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Runtime Notice: Accessing static property Proxies\__CG__\Bundle\Entity\Entity::$lazyPropertiesDefaults as non static. Symfony PropertyAccessor error #16485

Closed
@etiennerunge

Description

@etiennerunge

Hi there,

I have an error with Symfony 2.7.6 & Doctrine.
I try to serialize my 'Employee' Entity, which is a child of a Person superclass. This one has a relation with an 'Adresse' Entity.

When I serialize the Employee Entity, Symfony returns this error :

Runtime Notice: Accessing static property Proxies__CG__\WebInscriptionBundle\Entity\Contact\Adresse::$lazyPropertiesDefaults as non static
500 Internal Server Error - ContextErrorException

I understand the problem. Symfony try to access a property of my object, which is a proxy class.
I've changed the 'fetch mode' to EAGER, but nothing's change.
The property of the probleme belong to the proxy class. It's the public static $lazyPropertiesDefaults .
This issue is similar to this : http://stackoverflow.com/q/31623080

Here's the line which failed :
https://github.com/symfony/symfony/blob/v2.7.6/src/Symfony/Component/PropertyAccess/PropertyAccessor.php#L350

the property is static & public, but the getter __getLazyProperties isn't called, and symfony try to access as a public property ( $object->$property ).

So, the fetch mode EAGER seems to work (my entity is hydrated), maybe there is a mistake, a missing test ?
I think the visibility of my variables are ok. 'Protected' in the superclass and 'private' in child Employee Entity. Any ideas ?

Thanks !

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions