PUGXMultiUserBundle をインストールしようとしましたが、すべての手順を実行したので、アプリケーション (メインの場所のみ: http://localhost/jpp/web/app_dev.php
) をロードしようとしましたが、常に次のエラーが発生します。
致命的なエラー: 155 行目の C:\xampp\htdocs\JPP\vendor\symfony\symfony\src\Symfony\Component\Security\Core\Authentication\Token\AbstractToken.php で抽象クラス JPP\UserBundle\Entity\User をインスタンス化できません
いくつかのことを試しましたがうまくいきませんでした。助けていただけますか? 以下に、私の Entity クラスを示します。データベース内のすべてのテーブルを GIT で作成できました。レンティ クラスは、JPP/UserBundle/Entity の下にあります。さらにファイルが必要な場合は教えてください...どうもありがとうございました!!!
ロジャー
抽象ユーザー クラス:
<?php
namespace JPP\UserBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use FOS\UserBundle\Entity\User as BaseUser;
/**
* @ORM\Entity
* @ORM\Table(name="user")
* @ORM\InheritanceType("JOINED")
* @ORM\DiscriminatorColumn(name="type", type="string")
* @ORM\DiscriminatorMap({"userprofile" = "UserProfile", "usercompany" = "UserCompany"})
*
*/
abstract class User extends BaseUser
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
}
クラス UserCompany
<?php
// src/jpp/UserBundle/Entity/User.php
namespace JPP\UserBundle\Entity;
use PUGX\MultiUserBundle\Validator\Constraints\UniqueEntity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="userCompany")
* @UniqueEntity(fields = "username", targetClass = "JPP\UserBundle\Entity\User", message="fos_user.username.already_used")
* @UniqueEntity(fields = "email", targetClass = "JPP\UserBundle\Entity\User", message="fos_user.email.already_used")
*/
class UserCompany extends User
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @var integer
*
* @ORM\Column(name="usertype", type="integer")
*/
protected $userType;
/**
* @var string
*
* @ORM\Column(name="companyName", type="string", length=255)
*/
protected $companyName;
/**
* @var string
*
* @ORM\Column(name="sector", type="string", length=255)
*/
protected $sector;
/**
* @var string
*
* @ORM\Column(name="amountOfEmployees", type="string", length=255)
*/
protected $amountOfEmployees;
/**
* @var string
*
* @ORM\Column(name="turnover", type="string", length=255)
*/
protected $turnover;
/**
* @var string
*
* @ORM\Column(name="companyLink", type="string", length=255)
*/
protected $companyLink;
/**
* @var string
*
* @ORM\Column(name="facebookLink", type="string", length=255)
*/
protected $facebookLink;
/**
* @var string
*
* @ORM\Column(name="twitterLink", type="string", length=255)
*/
protected $twitterLink;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set userType
*
* @param integer $userType
* @return UserType
*/
public function setUserType($userType)
{
$this->userType = $userType;
return $this;
}
/**
* Get userType
*
* @return integer
*/
public function getUserType()
{
return $this->userType;
}
/**
* Set companyName
*
* @param string $companyName
* @return Company
*/
public function setCompanyName($companyName)
{
$this->companyName = $companyName;
return $this;
}
/**
* Get companyName
*
* @return string
*/
public function getCompanyName()
{
return $this->companyName;
}
/**
* Set sector
*
* @param string $sector
* @return Company
*/
public function setSector($sector)
{
$this->sector = $sector;
return $this;
}
/**
* Get sector
*
* @return string
*/
public function getSector()
{
return $this->sector;
}
/**
* Set amountOfEmployees
*
* @param string $amountOfEmployees
* @return Company
*/
public function setAmountOfEmployees($amountOfEmployees)
{
$this->amountOfEmployees = $amountOfEmployees;
return $this;
}
/**
* Get amountOfEmployees
*
* @return string
*/
public function getAmountOfEmployees()
{
return $this->amountOfEmployees;
}
/**
* Set turnover
*
* @param string $turnover
* @return Company
*/
public function setTurnover($turnover)
{
$this->turnover = $turnover;
return $this;
}
/**
* Get turnover
*
* @return string
*/
public function getTurnover()
{
return $this->turnover;
}
/**
* Set companyLink
*
* @param string $companyLink
* @return Company
*/
public function setCompanyLink($companyLink)
{
$this->companyLink = $companyLink;
return $this;
}
/**
* Get companyLink
*
* @return string
*/
public function getCompanyLink()
{
return $this->companyLink;
}
/**
* Set facebookLink
*
* @param string $facebookLink
* @return Company
*/
public function setFacebookLink($facebookLink)
{
$this->facebookLink = $facebookLink;
return $this;
}
/**
* Get facebookLink
*
* @return string
*/
public function getFacebookLink()
{
return $this->facebookLink;
}
/**
* Set twitterLink
*
* @param string $twitterLink
* @return Company
*/
public function setTwitterLink($twitterLink)
{
$this->twitterLink = $twitterLink;
return $this;
}
/**
* Get twitterLink
*
* @return string
*/
public function getTwitterLink()
{
return $this->twitterLink;
}
}
クラス UserProfile
// src/jpp/UserBundle/Entity/User.php
namespace JPP\UserBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use PUGX\MultiUserBundle\Validator\Constraints\UniqueEntity;
/**
* @ORM\Entity
* @ORM\Table(name="userProfile")
* @UniqueEntity(fields = "username", targetClass = "JPP\UserBundle\Entity\User", message="fos_user.username.already_used")
* @UniqueEntity(fields = "email", targetClass = "JPP\UserBundle\Entity\User", message="fos_user.email.already_used")
*/
class UserProfile extends User
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @var integer
*
* @ORM\Column(name="usertype", type="integer")
*/
protected $userType;
/**
* @ORM\Column(type="string", length=255)
*
*/
protected $foreName;
/**
* @ORM\Column(type="string", length=255)
*
*/
protected $surName;
/**
* @ORM\Column(type="string", length=255)
*
*/
protected $street;
/**
* @ORM\Column(type="string", length=255)
*
*/
protected $plz;
/**
* @ORM\Column(type="string", length=255)
*
*/
protected $place;
/**
* @ORM\Column(type="string", length=255)
*
*/
protected $phone;
/**
* @ORM\Column(type="string", length=255)
*
*/
protected $mobile;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set userType
*
* @param integer $userType
* @return UserType
*/
public function setUserType($userType)
{
$this->userType = $userType;
return $this;
}
/**
* Get userType
*
* @return integer
*/
public function getUserType()
{
return $this->userType;
}
/**
* Set foreName
*
* @param string $foreName
* @return ForeName
*/
public function setForeName($foreName)
{
$this->foreName = $foreName;
return $this;
}
/**
* Get foreName
*
* @return string
*/
public function getForeName()
{
return $this->foreName;
}
/**
* Set surName
*
* @param string $surName
* @return SurName
*/
public function setSurName($surName)
{
$this->surName = $surName;
return $this;
}
/**
* Get surName
*
* @return string
*/
public function getSurName()
{
return $this->surName;
}
/**
* Set street
*
* @param string $street
* @return Street
*/
public function setStreet($street)
{
$this->street = $street;
return $this;
}
/**
* Get street
*
* @return string
*/
public function getStreet()
{
return $this->street;
}
/**
* Set plz
*
* @param string $plz
* @return PLZ
*/
public function setPlz($plz)
{
$this->plz = $plz;
return $this;
}
/**
* Get plz
*
* @return string
*/
public function getPlz()
{
return $this->plz;
}
/**
* Set place
*
* @param string $place
* @return Place
*/
public function setPlace($place)
{
$this->place = $place;
return $this;
}
/**
* Get place
*
* @return string
*/
public function getPlace()
{
return $this->place;
}
/**
* Set phone
*
* @param string $phone
* @return Phone
*/
public function setPhone($phone)
{
$this->phone = $phone;
return $this;
}
/**
* Get phone
*
* @return string
*/
public function getPhone()
{
return $this->phone;
}
/**
* Set mobile
*
* @param string $mobile
* @return Mobile
*/
public function setMobile($mobile)
{
$this->mobile = $mobile;
return $this;
}
/**
* Get mobile
*
* @return string
*/
public function getMobile()
{
return $this->mobile;
}
//public function __construct()
//{
// parent::__construct();
// your own logic
//}
}