Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to retrieve referenced Object #11

Open
bigfoot90 opened this issue Dec 17, 2014 · 4 comments
Open

Unable to retrieve referenced Object #11

bigfoot90 opened this issue Dec 17, 2014 · 4 comments

Comments

@bigfoot90
Copy link

I'm having exception when I try to access to a referenced object's property

PHPCR\RepositoryException: Not an absolute path 'e7cbb4f0-74d7-4a7b-b8e3-758cb83061f2'

It seems like the listener is searching the document's Uuid in Id field.
For reference: https://github.com/bigfoot90/DoctrineOrmPhpcrAdapterTest/blob/access-to-reference/src/AppBundle/Tests/DoctrineOrmPhpcrAdpterTest.php#L60

@bigfoot90
Copy link
Author

Additional info: var_dump($entity->getDocument())

class PHPCRProxies\__CG__\AppBundle\Document\Page#1103 (4) {
  public $__initializer__ =>
  class Closure#1101 (3) {
    public $static =>
    array(2) {
      'className' =>
      string(23) "AppBundle\Document\Page"
      'documentManager' =>
      class Doctrine\ODM\PHPCR\DocumentManager#987 (11) {
        ...
      }
    }
    public $this =>
    class Doctrine\ODM\PHPCR\Proxy\ProxyFactory#952 (6) {
      private $documentManager =>
      class Doctrine\ODM\PHPCR\DocumentManager#987 (11) {
        ...
      }
      private $proxyNamespace =>
      string(12) "PHPCRProxies"
      private $metadataFactory =>
      class Doctrine\ODM\PHPCR\Mapping\ClassMetadataFactory#965 (8) {
        ...
      }
      private $proxyGenerator =>
      class Doctrine\Common\Proxy\ProxyGenerator#951 (4) {
        ...
      }
      private $autoGenerate =>
      int(1)
      private $definitions =>
      array(2) {
        ...
      }
    }
    public $parameter =>
    array(1) {
      '$proxy' =>
      string(10) "<required>"
    }
  }
  public $__cloner__ =>
  class Closure#1102 (3) {
    public $static =>
    array(4) {
      'className' =>
      string(23) "AppBundle\Document\Page"
      'classMetadata' =>
      class Doctrine\ODM\PHPCR\Mapping\ClassMetadata#902 (32) {
        ...
      }
      'documentManager' =>
      class Doctrine\ODM\PHPCR\DocumentManager#987 (11) {
        ...
      }
      'reflectionId' =>
      class ReflectionProperty#864 (2) {
        ...
      }
    }
    public $this =>
    class Doctrine\ODM\PHPCR\Proxy\ProxyFactory#952 (6) {
      private $documentManager =>
      class Doctrine\ODM\PHPCR\DocumentManager#987 (11) {
        ...
      }
      private $proxyNamespace =>
      string(12) "PHPCRProxies"
      private $metadataFactory =>
      class Doctrine\ODM\PHPCR\Mapping\ClassMetadataFactory#965 (8) {
        ...
      }
      private $proxyGenerator =>
      class Doctrine\Common\Proxy\ProxyGenerator#951 (4) {
        ...
      }
      private $autoGenerate =>
      int(1)
      private $definitions =>
      array(2) {
        ...
      }
    }
    public $parameter =>
    array(1) {
      '$cloned' =>
      string(10) "<required>"
    }
  }
  public $__isInitialized__ =>
  bool(false)
  public $id =>
  string(36) "e7cbb4f0-74d7-4a7b-b8e3-758cb83061f2"
}

@ElectricMaxxx
Copy link
Owner

Mh, that looks like my proxy problem. For that i Used to use an own fork of the doctrine-phpcr. The problem is that doctrine maps proxies by the documents ID=path. My fork is a not merged PR to a avoid that. Maybe we get a chance to merge it @dbu now? Or after refactoring the UoW? =

@bigfoot90
Copy link
Author

Please take me updated.

@dbu
Copy link

dbu commented Dec 18, 2014

@ElectricMaxxx do you mean this? doctrine/phpcr-odm#493

waiting for the new UoW by ocramius will take a long time. i think your PR is a very good idea, it will allow a smoother transition towards phpcr-odm 2.0 then...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants