ssossossosso

Forums

Covering OroCRM topics, including community updates and company announcements.  Subscribe

This topic contains 0 replies, has 1 voice, and was last updated by  Geoffroy Cochard 2 years, 1 month ago.

  • Creator
    Topic
  • #12665

    Geoffroy Cochard
    Participant

    Hi,
    I would like to add phone, address, email capabilities to many custom RegularEntity and store all in same table.

    My choice for the moment has to be to create EntityContactBundle with this below entities


    Namespace ****\****\Entity\Phone
    use Oro\Bundle\AddressBundle\Entity\AbstractPhone;
    /**
    * @ORM\Entity
    * @ORM\Table("co_phone", indexes={
    * @ORM\Index(name="primary_phone_idx", columns={"phone", "is_primary"}),
    * @ORM\Index(name="phone_idx", columns={"phone"})
    * })
    */
    class Phone extends AbsractPhone
    {}

    Namespace ****\****\Entity\Email
    use Oro\Bundle\EmailBundle\Entity\EmailInterface;
    use Oro\Bundle\AddressBundle\Entity\AbstractEmail;
    /**
    * @ORM\Entity
    * @ORM\Table("co_email", indexes={
    * @ORM\Index(name="primary_email_idx", columns={"email", "is_primary"})
    * })
    */
    class Email AbstractEmail implements EmailInterface
    {}

    And add OneToMany relation from my CustomEntity to these Email, Phone entities.

    Is the right way ?
    Must should i have to extend OroAddressBundle ?

    Geoffroy

You must be logged in to reply to this topic.