Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Authentication Zf2,zfcUser, Doctrine2: The script tried to execute a method or access a property of an incomplete object
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
booradley  
View profile  
 More options Sep 7 2012, 3:58 pm
From: booradley <david.quint...@gmail.com>
Date: Fri, 7 Sep 2012 12:58:45 -0700 (PDT)
Local: Fri, Sep 7 2012 3:58 pm
Subject: Authentication Zf2,zfcUser, Doctrine2: The script tried to execute a method or access a property of an incomplete object

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 must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marco Pivetta  
View profile  
 More options Sep 8 2012, 10:59 am
From: Marco Pivetta <ocram...@gmail.com>
Date: Sat, 8 Sep 2012 16:59:21 +0200
Local: Sat, Sep 8 2012 10:59 am
Subject: Re: [doctrine-dev] Authentication Zf2,zfcUser, Doctrine2: The script tried to execute a method or access a property of an incomplete object

Hey Booradley,

I have no understanding of how zfc-user works on the sessions (it should
actually only use the ID afail).
I can suggest you to use this auth storage:
https://github.com/doctrine/DoctrineModule/blob/master/src/DoctrineMo...

Marco Pivetta

http://twitter.com/Ocramius

http://marco-pivetta.com

On 7 September 2012 21:58, booradley <david.quint...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »