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

Forums Forums OroPlatform OroPlatform – Programming Questions Use AddressBundle elements with a custom RegularEntity

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

  • Creator
  • #28443

    Geoffroy Cochard

    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 ?


You must be logged in to reply to this topic.