相关疑难解决方法(0)

FOS UserBundle无法登录

关于我的UserBundle,我又回到了另一个问题:通过Symfony2安装和配置FOS捆绑包时,一切都很完美,它甚至让我创建了2个正确插入我的数据库的用户.

但是,每次我尝试登录这些帐户时,都会出现以下错误

Warning: Erroneous data format for unserializing 'VillaPrivee\UserBundle\Entity\User' in /Users/Vianney/Projets/VillaPrivee/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php line 869
Run Code Online (Sandbox Code Playgroud)

这就是869行所指的:

/**
     * Creates a new instance of the mapped class, without invoking the constructor.
     *
     * @return object
     */
    public function newInstance()
    {
        if ($this->_prototype === null) {
            $this->_prototype = unserialize(sprintf('O:%d:"%s":0:{}', strlen($this->name), $this->name));
        }

        return clone $this->_prototype;
    }
Run Code Online (Sandbox Code Playgroud)

这是我的用户实体:

namespace VillaPrivee\UserBundle\Entity;

use FOS\UserBundle\Model\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name="fos_user")
 */
class User extends BaseUser
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * …
Run Code Online (Sandbox Code Playgroud)

symfony doctrine-orm fosuserbundle

27
推荐指数
2
解决办法
1万
查看次数

标签 统计

doctrine-orm ×1

fosuserbundle ×1

symfony ×1