I have UserBundle who extends FOSUserBundle, and entity User who extends FOS's User class. On my localhost work fine, but on hosting i've got error:
Fatal error: Uncaught exception 'Doctrine\ORM\Mapping\MappingException' with message 'No identifier/primary key specified for Entity "WisJa\CoreBundle\Entity\User" sub class of "FOS\UserBundle\Model\User". Every Entity must have an identifier/primary key.' in...
My User entity all code:
<?php
namespace WisJa\CoreBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use FOS\UserBundle\Model\User as BaseUser;
/**
* @ORM\Table(name="fos_user")
* @ORM\Entity
*/
class User extends BaseUser
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @var string
*
* @ORM\Column(name="facebook", type="string", nullable=true, length=255)
*/
protected $facebook;
public function __construct()
{
parent::__construct();
// your own logic
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set facebook
*
* @param string $facebook
* @return User
*/
public function setFacebook($facebook)
{
$this->facebook = $facebook;
return $this;
}
/**
* Get facebook
*
* @return string
*/
public function getFacebook()
{
return $this->facebook;
}
}
I have no idea why it works on localhost but don't works in web...
cache
dir – Victor Bocharsky