Publico parte de la entidad que me interesa del correo:
Código PHP:
/**
* @Assert\Valid
* @ORM\OneToMany(targetEntity="AbcMemberMediaCommunication", mappedBy="member", cascade={"persist", "remove"})
*/
protected $emails;
public function __construct()
{
$this->emails = new DoctrineCommonCollectionsArrayCollection();
}
public function setEmails(DoctrineCommonCollectionsCollection $emails)
{
$this->emails = $emails;
foreach($emails as $email){
$email->setMember($this);
}
return $this;
}
public function getEmails() {
return $this->emails;
}
Y estos son los atributos que tengo en la entidad donde tengo los correos:
Código PHP:
private $id;
private $media;
private $createdDate;
private $mediaType;
/*
* @ORM\ManyToOne(targetEntity="AbcMembers", inversedBy="emails")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="member", referencedColumnName="id")
* })
*/
private $member;
private $primaryMedia;