Hi,

 

I am getting such an error:

MappingException: Class Acme\UserBundle\Entity\User is not a valid entity or
mapped super class

 

I tried almost everything but I am stacked with that errorall the time.

 

My User class looks like this :

 

// src/Acme/UserBundle/Entity/User.php

 

namespace Acme\UserBundle\Entity;

 

use FOS\UserBundle\Entity\User as BaseUser;

use Doctrine\ORM\Mapping as ORM;

 

class User extends BaseUser

{

    /**

     * @var string

     *

     * @ORM\Column(name="firstname", type="string", length=255)

     */

    

                protected $firstname;

 

    /**

     * @var string

     *

     * @ORM\Column(name="lastname", type="string", length=255)

     */

    protected $lastname;

 

    /**

     * @var string

     *

     * @ORM\Column(name="facebookId", type="string", length=255)

     */

    protected $facebookId;

 

 

    public function serialize()

    {

        return serialize(array($this->facebookId, parent::serialize()));

    }

 

    public function unserialize($data)

    {

        list($this->facebookId, $parentData) = unserialize($data);

        parent::unserialize($parentData);

    }

 

 

 

    /**

     * @return string

     */

    public function getFirstname()

    {

        return $this->firstname;

    }

 

    /**

     * @param string $firstname

     */

    public function setFirstname($firstname)

    {

        $this->firstname = $firstname;

    }

 

    /**

     * @return string

     */

    public function getLastname()

    {

        return $this->lastname;

    }

 

    /**

     * @param string $lastname

     */

    public function setLastname($lastname)

    {

        $this->lastname = $lastname;

    }

 

    /**

     * Get the full name of the user (first + last name)

     * @return string

     */

    public function getFullName()

    {

        return $this->getFirstName() . ' ' . $this->getLastname();

    }

 

    /**

     * @param string $facebookId

     * @return void

     */

    public function setFacebookId($facebookId)

    {

        $this->facebookId = $facebookId;

        $this->setUsername($facebookId);

        $this->salt = '';

    }

 

    /**

     * @return string

     */

    public function getFacebookId()

    {

        return $this->facebookId;

    }

 

    /**

     * @param Array

     */

    public function setFBData($fbdata)

    {

        if (isset($fbdata['id'])) {

            $this->setFacebookId($fbdata['id']);

            $this->addRole('ROLE_FACEBOOK');

        }

        if (isset($fbdata['first_name'])) {

            $this->setFirstname($fbdata['first_name']);

        }

        if (isset($fbdata['last_name'])) {

            $this->setLastname($fbdata['last_name']);

        }

        if (isset($fbdata['email'])) {

            $this->setEmail($fbdata['email']);

        }

    }

}

 

Looking forward for an answer. J

 

Regards

 

Grzegorz FloryaƄski

WWW. www.apartamenty-florian.pl

Tel. 503-052-210 

Mail. grzeg...@apartamenty-florian.pl

 

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to