JMSPaymentCoreBundle を実装しようとしていますが、以下のエラーが発生します。
[Doctrine\ORM\Mapping\MappingException]
The target-entity CTC\Bundle\OrderBundle\Entity\JMSPaymentCore:PaymentInstruction cannot be found in 'CTC\Bundle\OrderBundle\Entity\Order#paymentInstruction'.
ドキュメントに何か不足していますか? 名前空間や targetEntity の値に不一致があるのかもしれませんが、わかりません。
doctrine:generate:entities の後、setter と getter が奇妙に見えることにも気付きました。
何か案が ?あなたの助けに感謝します。
ここに私の完全な Order エンティティ Class があります:
<?php
namespace CTC\Bundle\OrderBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use JMS\Payment\CoreBundle\Entity\PaymentInstruction;
/**
* Orders
*
* @ORM\Table(name="Orders")
* @ORM\Entity(repositoryClass="CTC\Bundle\OrderBundle\Repository\OrdersRepository")
*/
class Order
{
/**
* @var integer
*
* @ORM\Column(name="OrderID", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/** @ORM\OneToOne(targetEntity="JMSPaymentCore:PaymentInstruction") */
private $paymentInstruction;
/**
* @var string
*
* @ORM\Column(name="OrderReference", type="string", length=100)
*/
private $reference;
/**
*
* @ORM\ManyToOne(targetEntity="CTC\Bundle\UserBundle\Entity\User", inversedBy="orders")
* @ORM\JoinColumn(name="UserID", referencedColumnName="id")
*/
private $user;
/**
*
* @ORM\ManyToOne(targetEntity="CTC\Bundle\CreditPackageBundle\Entity\CreditPackage")
* @ORM\JoinColumn(name="CreditPackageID", referencedColumnName="CreditPackageID")
*/
private $package;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set reference
*
* @param string $reference
* @return Orders
*/
public function setReference($reference)
{
$this->reference = $reference;
return $this;
}
/**
* Get reference
*
* @return string
*/
public function getReference()
{
return $this->reference;
}
/**
* Set user
*
* @param \CTC\Bundle\UserBundle\Entity\User $user
* @return Order
*/
public function setUser(\CTC\Bundle\UserBundle\Entity\User $user = null)
{
$this->user = $user;
return $this;
}
/**
* Get user
*
* @return \CTC\Bundle\UserBundle\Entity\User
*/
public function getUser()
{
return $this->user;
}
/**
* Set package
*
* @param \CTC\Bundle\CreditPackageBundle\Entity\CreditPackage $package
* @return Order
*/
public function setPackage(\CTC\Bundle\CreditPackageBundle\Entity\CreditPackage $package = null)
{
$this->package = $package;
return $this;
}
/**
* Get package
*
* @return \CTC\Bundle\CreditPackageBundle\Entity\CreditPackage
*/
public function getPackage()
{
return $this->package;
}
/**
* Set paymentInstruction
*
* @param \CTC\Bundle\OrderBundle\Entity\JMSPaymentCore:PaymentInstruction $paymentInstruction
* @return Order
*/
public function setPaymentInstruction(\CTC\Bundle\OrderBundle\Entity\JMSPaymentCore:PaymentInstruction $paymentInstruction = null)
{
$this->paymentInstruction = $paymentInstruction;
return $this;
}
/**
* Get paymentInstruction
*
* @return \CTC\Bundle\OrderBundle\Entity\JMSPaymentCore:PaymentInstruction
*/
public function getPaymentInstruction()
{
return $this->paymentInstruction;
}
}