Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-940

Entities can / can not have private properties

    Details

    • Type: Documentation Documentation
    • Status: Open
    • Priority: Trivial 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

        Activity

        Ray Rehbein created issue -
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Workflow jira [ 12236 ] jira-feedback [ 13891 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback [ 13891 ] jira-feedback2 [ 15755 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 15755 ] jira-feedback3 [ 18012 ]

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-940, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Roman S. Borschel
            Reporter:
            Ray Rehbein
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: