Symfony 2.1을 사용하여 고객 사례 관리 시스템을 만들고 있습니다. 해결할 수없는 이상한 문제가 발생했습니다. 나는 응용 프로그램의 일부가 해당 인터페이스를 요구하고 아무 생각이Symfony2 클래스 UserInterface가 존재하지 않습니다.
"Class HSW\AshaBundle\Entity\UserInterface does not exist"
500 Internal Server Error
: 나는 CustomerCaseController
으로 showAction을 어떤 이유로, 나는 다음과 같은 오류가 발생합니다. 빈 UserInterface.php
클래스를 만들면 문제가으로 사라지고 모든 것이 작동합니다. showAction
에 UserInterface
이 필요한 이유는 무엇입니까?
:
$customercase = $this->getDoctrine() ->getRepository('HSWAshaBundle:CustomerCase') ->find($id);
을 내가 가지고있는 다음과 같은 기관 :
User
(로그인 및 제출 경우에)
Customer
(고객의 경우)CustomerCase
(사례)
CustomerCase
는 다음과 같은 방법으로 Customer
및 User
단체와 ManyToOne 관계가 있습니다
// SRC/HSW/AshaBundle/법인/CustomerCase.php 네임 스페이스 HSW \ AshaBundle \ 엔티티;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Doctrine\Common\Collections\ArrayCollection;
/**
* CustomerCase
*
* @ORM\Table(name="hsw_customerCase")
* @ORM\Entity
* @Gedmo\Loggable
* @Gedmo\SoftDeleteable(fieldName="deletedAt")
*/
class CustomerCase
{
/**
* @ORM\ManyToOne(targetEntity="Customer", inversedBy="customerCases")
* @ORM\JoinColumn(name="customer_id", referencedColumnName="id", nullable=false)
*/
protected $customer;
/**
* @ORM\ManyToOne(targetEntity="User", inversedBy="createdCustomerCases")
* @ORM\JoinColumn(name="creator_id", referencedColumnName="id", nullable=false)
*/
protected $creator;
/**
* @ORM\ManyToOne(targetEntity="User", inversedBy="holdingCustomerCases")
* @ORM\JoinColumn(name="holder_id", referencedColumnName="id", nullable=false)
*/
protected $holder;
.....etc....
// SRC/HSW/AshaBundle/법인/CustomerCase.php 네임 스페이스 HSW \ AshaBundle \ 엔티티;
use Symfony\Component\Security\Core\User\EquatableInterface;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\User\AdvancedUserInterface;
use Doctrine\Common\Collections\ArrayCollection;
/**
* HSW\AshaBundle\Entity\User
*
* @ORM\Table(name="hsw_users")
* @ORM\Entity(repositoryClass="HSW\AshaBundle\Entity\UserRepository")
*/
class User implements AdvancedUserInterface
{
.....etc....
은 사용자 엔티티와의 관계는 어떻게 든이에 영향을 미칠 수 있을까요? 그 차이는
CustomerCase.php
과
Customer.php
사이입니다 (
UserInterface
없이는
showAction
이 작동 함).
이 동작을 디버깅 할 수있는 사람이 있습니까? Symfony가 (알 수없는 이유로)를 요구하기 때문에 비어있는 UserInterface
클래스를 갖는 것만으로는 쓸모없는 것처럼 보입니다.
게시물을 편집하고 네임 스페이스 선언을 표시하고 CustomerCase 및 User 엔티티에서 문을 사용할 수 있습니까? – Mike
감사합니다. 마이크, 방금 두 엔티티의 시작 부분을 추가했습니다. AdvancedUserInterface를 로그인 용으로 사용하고 있습니다 (전자 메일로 로그인 허용). 이것이 어떻게 든 이러한 문제의 원인이 될 수 있습니까? – user1903831