persistContact example

$recipient['id']
            );
            if ($contact instanceof Contact) {
                $associatedContacts[] = $contact;
            }
        }

        foreach (array_keys($unknownRecipients) as $recipient) {
            $contact = new Contact();
            $contact->setMailAddress((string) $recipient);

            $this->persistContact($contact);

            $fetchedContact = $this->entityManager->getReference(
                Contact::class,
                $contact->getId()
            );
            if ($fetchedContact instanceof Contact) {
                $associatedContacts[] = $fetchedContact;
            }
        }

        $collection = new ArrayCollection($associatedContacts);
        
Home | Imprint | This part of the site doesn't use cookies.