I'm trying to implement JMSPaymentCoreBundle but I get this error below.
[Doctrine\ORM\Mapping\MappingException]
The target-entity CTC\Bundle\OrderBundle\Entity\JMSPaymentCore:PaymentInstruction cannot be found in 'CTC\Bundle\OrderBundle\Entity\Order#paymentInstruction'.
Am I missing something in the doc ? Perhaps is there a mismatch with namespacing or the targetEntity value but I don't understand.
I also noticed that after my doctrine:generate:entities, the setter and getter seems strange.
Any idea ? I thank you for your help.
Here is my full Order entity 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;
}
}
You have typed a wrong namespace syntax.
The short syntax with
:
is not acceptable here.Take a look at your other namespace declarations and fix it with full namespace.
Like this one.
- Update -
I believe, this should be the full namespace
JMS\Payment\CoreBundle\Entity\PaymentInstruction