Announcement

Collapse
No announcement yet.

Setting phoneNumberData of a Related Entity

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Setting phoneNumberData of a Related Entity

    So I've been able to retrieve phoneNumberData from related Entities using
    Code:
    $contactId = $entity->get('contactsId');
    $contact = $entityManager->getEntity('Contact', $contactId);
    $phones = $this->getEntityManager()->getRepository('PhoneNumber')->getPhoneNumberData($contact);
    is there a way to set phoneNumberData using the ORM? It seems to work okay when i use the entity->set method if it is just a single number but when there are multiples it becomes a problem.
    is there a method to set Phone number data for a specific entity, and if not how do you set multiple phone numbers to a related entity?

  • #2


    you can save contact with correct phoneNumbeData field and it will work.

    Comment


    • #3
      you mean like this
      Code:
      $assignmentsIds = $entity->get('assignmentsIds');
      $assignments = $entityManager->getEntity('Case', $assignmentsIds);
      
       $this->getEntityManager()->getRepository('PhoneNumber')->storeEntityPhoneNumber($assignments);
      I want to save it to the related Cases...
      ??

      Comment


      • #4

        Is assignmentsIds field an id of one single Case? Does Case have phoneNumber field?

        Comment

        Working...
        X