JMSPaymentCoreBundle : 当 doctrine:schema:update --force 时出错



我正在尝试实现JMSPaymentCoreBundle,但我在下面收到此错误。

[DoctrineORMMappingMappingException]                                                                                              
The target-entity CTCBundleOrderBundleEntityJMSPaymentCore:PaymentInstruction cannot be found in 'CTCBundleOrderBundleEntityOrder#paymentInstruction'.

我在文档中遗漏了什么吗?也许与命名空间或目标实体值不匹配,但我不明白。

我还注意到,在我的学说:生成:实体之后,二传手和获取者似乎很奇怪。

知道吗?我感谢您的帮助。

这是我的完整订单实体类:

<?php
namespace CTCBundleOrderBundleEntity;
use DoctrineORMMapping as ORM;
use JMSPaymentCoreBundleEntityPaymentInstruction;
/**
 * Orders
 *
 * @ORMTable(name="Orders")
 * @ORMEntity(repositoryClass="CTCBundleOrderBundleRepositoryOrdersRepository")
 */
class Order
{
    /**
     * @var integer
     *
     * @ORMColumn(name="OrderID", type="integer")
     * @ORMId
     * @ORMGeneratedValue(strategy="AUTO")
     */
    private $id;
    
    /** @ORMOneToOne(targetEntity="JMSPaymentCore:PaymentInstruction") */
    private $paymentInstruction;
    /**
     * @var string
     *
     * @ORMColumn(name="OrderReference", type="string", length=100)
     */
    private $reference;
    
    /**
     *
     * @ORMManyToOne(targetEntity="CTCBundleUserBundleEntityUser", inversedBy="orders")
     * @ORMJoinColumn(name="UserID", referencedColumnName="id")
     */
    private $user;
    
    /**
     *
     * @ORMManyToOne(targetEntity="CTCBundleCreditPackageBundleEntityCreditPackage")
     * @ORMJoinColumn(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 CTCBundleUserBundleEntityUser $user
     * @return Order
     */
    public function setUser(CTCBundleUserBundleEntityUser $user = null)
    {
        $this->user = $user;
        return $this;
    }
    /**
     * Get user
     *
     * @return CTCBundleUserBundleEntityUser 
     */
    public function getUser()
    {
        return $this->user;
    }
    /**
     * Set package
     *
     * @param CTCBundleCreditPackageBundleEntityCreditPackage $package
     * @return Order
     */
    public function setPackage(CTCBundleCreditPackageBundleEntityCreditPackage $package = null)
    {
        $this->package = $package;
        return $this;
    }
    /**
     * Get package
     *
     * @return CTCBundleCreditPackageBundleEntityCreditPackage 
     */
    public function getPackage()
    {
        return $this->package;
    }
    /**
     * Set paymentInstruction
     *
     * @param CTCBundleOrderBundleEntityJMSPaymentCore:PaymentInstruction $paymentInstruction
     * @return Order
     */
    public function setPaymentInstruction(CTCBundleOrderBundleEntityJMSPaymentCore:PaymentInstruction $paymentInstruction = null)
    {
        $this->paymentInstruction = $paymentInstruction;
        return $this;
    }
    /**
     * Get paymentInstruction
     *
     * @return CTCBundleOrderBundleEntityJMSPaymentCore:PaymentInstruction 
     */
    public function getPaymentInstruction()
    {
        return $this->paymentInstruction;
    }
}

键入了错误的命名空间语法。

@ORMOneToOne(targetEntity="JMSPaymentCore:PaymentInstruction")

此处不接受带有 : 的简短语法。

查看其他命名空间声明并使用完整命名空间修复它。

@ORMManyToOne(targetEntity="CTCBundleCreditPackageBundleEntityCreditPackage")

比如这个。

-更新-

我相信,这应该是完整的命名空间JMSPaymentCoreBundleEntityPaymentInstruction

相关内容

  • 没有找到相关文章

最新更新