Skip to content

Instantly share code, notes, and snippets.

@roderik
Created Oct 25, 2013
Embed
What would you like to do?
$contact = $dm->createQueryBuilder('KunstmaanPeerPressureDMBundle:Contact')
->field('address')->equals($row[2])
->field('zipcode')->equals((string)$row[3])
->getQuery()
->getSingleResult();
if (!$contact) {
$contact = new Contact();
$contact->setLastname($row[1]);
$contact->setAddress($row[2]);
$contact->setZipcode($row[3]);
$contact->setCity($row[4]);
$contact->setCountry($row[5]);
$contact->setLanguage($row[6]);
$contact->setCustomer(true);
$dm->persist($contact);
$dm->flush();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment