嗨,我有以下课程
namespace MP\User\RegistrationBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Persistence\PersistentObject;
use MP\Services\SiteAdapterBundle\Util\String;
/**
* @ORM\Table(name="customer")
* @ORM\Entity(repositoryClass="MP\User\RegistrationBundle\Repositories\CustomerRepository")
* @ORM\HasLifecycleCallbacks
*/
class Customer extends PersistentObject
{
/**
* @var string $id
* @ORM\Id
* @ORM\Column(name="icustomer_id", type="integer")
*/
protected $id;
/**
* @var string $addresses
* @ORM\OneToMany(targetEntity="MP\User\RegistrationBundle\Entity\Address", mappedBy="customer", cascade={"remove"})
*/
protected $addresses;
有以下关系
/**
* MP\User\RegistrationBundle\Entity
*/
namespace MP\User\RegistrationBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Persistence\PersistentObject;
/**
* @ORM\Table(name="custdeladd")
* @ORM\Entity(repositoryClass="MP\User\RegistrationBundle\Repositories\AddressRepository")
*/
class Address extends PersistentObject
{
/**
* @var integer $suffix
* @ORM\Column(name="isuffix", type="integer")
* @ORM\Id
*/
protected $suffix;
/**
* @var object $customer
* @ORM\ManyToOne(targetEntity="MP\User\RegistrationBundle\Entity\Customer", inversedBy="addresses", cascade={"persist"})
* @ORM\JoinColumn(name="icustomer_id", referencedColumnName="icustomer_id")
*/
protected $customer;
}
有谁知道为什么当客户被删除时地址不是?非常感谢