0
我正在使用Doctrine2構建Zend Framework 2網站。我是開發Windows和一切工作,但我已經上傳我的代碼到Linux環境,這個錯誤已經出現:原則:在Windows上映射,但在Linux上映射
The target-entity LeuerOneYear\Entity\UserLeagueRole cannot be found in 'User\Entity\User#leagueRoles'.
這是我的實體:
<?php
namespace User\Entity;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use LeuerOneYear\Entity\UserLeagueRole;
use Doctrine\Common\Collections\ArrayCollection;
/**
* User
*
* @ORM\Table(name="user")
* @ORM\Entity
*/
class User
{
/**
* @var integer
*
* @ORM\Column(name="UserId", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="Login", type="string", length=15, nullable=false)
*/
private $login;
/**
* @var string
*
* @ORM\Column(name="password", type="string", length=45, nullable=false)
*/
private $password;
/**
* @var string
*
* @ORM\Column(name="Email", type="string", length=100, nullable=false)
*/
private $email;
/**
* @var \DateTime
* @Gedmo\Timestampable(on="create")
* @ORM\Column(name="CreatedOn", type="datetime", nullable=false)
*/
private $createdon;
/**
*
* @var string
*/
private $appRole;
/**
*
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\OneToMany(targetEntity="LeuerOneYear\Entity\UserLeagueRole", mappedBy="user", cascade={"persist"})
*/
private $leagueRoles;
和:
<?php
namespace LeuerOneYear\Entity;
use Doctrine\ORM\Mapping as ORM;
use User\Entity\User;
/**
* Userleaguerole
*
* @ORM\Table(name="userleaguerole", indexes={@ORM\Index(name="UserRole_League_idx", columns={"LeagueId"}), @ORM\Index(name="UserRole_Role_idx", columns={"RoleId"}), @ORM\Index(name="IDX_5D9987ED631A48FA", columns={"UserId"})})
* @ORM\Entity
*/
class UserLeagueRole
{
// /**
// * @var \User\Entity\User
// *
// * @ORM\Id
// * @ORM\GeneratedValue(strategy="NONE")
// * @ORM\OneToMany(targetEntity="User\Entity\User", mappedBy="leaguerole")
// * })
// */
/**
*
* @var User\Entity\User $user
*
* @ORM\Id
* @ORM\GeneratedValue(strategy="NONE")
* @ORM\ManyToOne(targetEntity="User\Entity\User", inversedBy="leagueRoles")
* @ORM\JoinColumn(name="UserId", referencedColumnName="UserId")
*/
private $user;
/**
* @var \LeuerOneYear\Entity\League
*
* @ORM\Id
* @ORM\GeneratedValue(strategy="NONE")
* @ORM\ManyToOne(targetEntity="LeuerOneYear\Entity\League", inversedBy="userRoles")
* @ORM\JoinColumn(name="LeagueId", referencedColumnName="LeagueId")
*
*/
private $league;
/**
* @var \LeuerOneYear\Entity\LeagueRole
*
* @ORM\ManyToOne(targetEntity="LeuerOneYear\Entity\LeagueRole")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="RoleId", referencedColumnName="RoleId")
* })
*/
private $role;
正如你可以看到用戶和UserLeagueRole之間的ManyToOne關係。
你知道爲什麼這個映射在Windows上工作,但在Linux中失敗嗎?