I have a doctrine Entity User, that implements AdvancedUserInterface. The entity has a field properties of class UserProperties, that is mapped as an object type.
My Entity:
class User implements AdvancedUserInterface, \Serializable {
<....>
/**
* @var UserProperties
*
* @ORM\Column(name="properties", type="object", nullable=true, options={"default":null})
*/
private $properties;
<....>
}
Properties class:
class UserProperties {
public $isEmailVisible = false;
public $isNameVisible = false;
}
If the properties value in the database is null and I do some changes to the entity object setting the properties - it's working fine. But if I commit some changes to the database and the properties field is NOT null (there is already a serialized UserProperties object) - the changes are not saved (but all other changes on the User entity are).
What do I do wrong?