> Hi there,
> When i want to get identity from zfcUserAuthentication like this:
> $id = $this->zfcUserAuthentication()->getIdentity()->getId();
> Fatal error: The script tried to execute a method or access a property of
> an incomplete object.
> Please ensure that the class definition "Membre\Entity\Membre" of the
> object you are trying to operate on was loaded _before_ unserialize() gets
> called or provide a __autoload() function to load the class definition
> Here is my entity:
> http://pastebin.com/tw1aC6ZQ
> <?php
> $options = array(
> 'objectManager' => $this->getEm(),
> 'objectRepository' =>
> $this->getEm()->getRepository('Membre\Entity\Membre') ,
> 'identityClass' => 'Membre\Entity\Membre',
> 'identityProperty' => $identityColumn,
> 'credentialProperty' => 'password'
> #'credentialCallable' => null
> );
> $doctrineAuthAdapter = new
> \DoctrineModule\Authentication\Adapter\ObjectRepository($options);
> $doctrineAuthAdapter->setIdentityValue($identity);
> $doctrineAuthAdapter->setCredentialValue($password);
> $authenticationService = new \Zend\Authentication\AuthenticationService();
> $authResult =
> $authenticationService->authenticate($doctrineAuthAdapter);
> ?>
> To avoid this error i can do:
> $authenticationService->getStorage()->write(serialize($identity));
> But then, i can't use
> $this->zfcUserAuthentication()->getIdentity()->getId() :
> Fatal error: Call to a member function getId() on a non-object
> Can anyone help me?
> --
> You received this message because you are subscribed to the Google Groups
> "doctrine-dev" group.
> To view this discussion on the web, visit
> https://groups.google.com/d/msg/doctrine-dev/-/XYvdlJPf1ucJ.
> To post to this group, send an email to doctrine-dev@googlegroups.com.
> To unsubscribe from this group, send email to
> doctrine-dev+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/doctrine-dev?hl=en-GB.