こんにちは私は次のクラスを持っています
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;
}
顧客が削除されたときにアドレスが削除されない理由を誰かが知っていますか?どうもありがとう