我怎样才能解决这个问题?
<?php
namespace entity;
/**
* @Entity @Table(name="debt")
* */
class Debt {
/**
* @Id @Column(type="integer") @GeneratedValue
* */
protected $id;
/**
* @Column(type="integer")
* */
protected $value;
/**
* @ManyToOne(targetEntity="people", inversedBy="debts")
* */
protected $who;
public function setValue($value) {
$this->value = $value;
}
public function setWho(Who $who) {
$this->who = $who;
}
public function getValue() {
return $this->value;
}
public function getWho() {
return $this->who;
}
}
<?php
namespace entity;
/**
* @Entity @Table(name="people")
* */
class People {
/**
* @Id @Column(type="integer") @GeneratedValue
* */
protected $id;
/**
* @Column(type="string")
* */
protected $name;
/**
* @OneToMany(targetEntity="debt", mappedBy="who")
* */
protected $debts;
public function setName($name) {
$this->name = $name;
}
public function assignDebt(Debt $debt) {
$this->debts[] = $debt;
}
public function getName() {
return $this->name;
}
public function getDebts() {
return $this->debts;
}
}
当我尝试:$em->getRepository("entity\Debt")->findAll()
我收到此错误:
警告:require(C:\Windows\TEMP__CG__entitypeople.php):无法打开流:C:\xampp\htdocs\skola\vendor\doctrine\orm\lib\Doctrine\ORM\Proxy\ProxyFactory 中没有这样的文件或目录。第 92 行的 php
致命错误:require():在 C 中打开所需的 'C:\Windows\TEMP__CG__entitypeople.php' (include_path='.;C:\xampp\php\pear;C:\pear;\xampp\php\PEAR') 失败:\xampp\htdocs\skola\vendor\doctrine\orm\lib\Doctrine\ORM\Proxy\ProxyFactory.php 在第 92 行
当我删除这部分时,它也可以工作:
/**
* @ManyToOne(targetEntity="people", inversedBy="debts")
* */
protected $who;