[DDC-940] Entities can / can not have private properties Created: 15/Dec/10  Updated: 15/Dec/10

Status: Open
Project: Doctrine 2 - ORM
Component/s: Documentation
Affects Version/s: 2.0-RC2
Fix Version/s: None
Security Level: All

Type: Documentation Priority: Trivial
Reporter: Ray Rehbein Assignee: Roman S. Borschel
Resolution: Unresolved Votes: 0
Labels: None

PHP 5.3.3 (cli) (built: Nov 14 2010 16:54:26)


In the note in
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.


class A {
    private $a = null;

    public function setValue($value) {
        $this->a = $value;

class B extends A {}

$b = new B();

$c = unserialize(serialize($b));

The output suggests private variables are serialized, and are restored fine

Generated at Wed Nov 25 22:31:49 EST 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.