Details
-
Type:
Documentation
-
Status:
Open
-
Priority:
Trivial
-
Resolution: Unresolved
-
Affects Version/s: 2.0-RC2
-
Fix Version/s: None
-
Component/s: Documentation
-
Security Level: All
-
Labels:None
-
Environment:PHP 5.3.3 (cli) (built: Nov 14 2010 16:54:26)
Description
In the note in
http://www.doctrine-project.org/docs/orm/2.0/en/reference/working-with-objects.html#merging-entities
It appears to state that private variables are not serialized for child objects
If this is the only reason entities can't have private properties, then this restriction is no longer valid, or possibly be reconsidered.
<?php
class A {
private $a = null;
public function setValue($value) {
$this->a = $value;
}
}
class B extends A {}
$b = new B();
$b->setValue("B");
var_dump($b);
$c = unserialize(serialize($b));
var_dump($c);
The output suggests private variables are serialized, and are restored fine