首页 文章

EntityAudit - Doctrine2:在OneToMany和OneToOne中使用相同的实体

提问于
浏览
1

是否可以使用simplethings / EntityAudit进行审计实体 - https://github.com/simplethings/EntityAudit

在OneToMany和OneToOne关系中使用相同的实体?

class Address
    {
        /**
         * @ORM\Column 
         */
        protected $address_text;

        /**
         * @ORM\ManyToOne(targetEntity="Customer", inversedBy="addresses") 
         */
        protected $customer;
    }



    class Customer 
    {
        /**
        * @ORM\OneToMany(targetEntity="Address", mappedBy="customer")
        */
        protected $addresses;

        /**
        * @ORM\OneToOne(targetEntity="Address")
        */
        protected $primary_address;
    }

没有审计它完美的工作,但有了它 - 脚本结束于 UnitOfWork::getEntityIdentifier 与"Unidentified index"通知

1 回答

相关问题