Beispiel #1
0
 protected function getUser($user)
 {
     $em = $this->getDoctrine()->getEntityManager();
     if (!$user->getProfile()->getProfileAddress()) {
         $address = new \Club\UserBundle\Entity\ProfileAddress();
         $address->setContactType('home');
         $address->setProfile($user->getProfile());
         $user->getProfile()->setProfileAddress($address);
     }
     if (!$user->getProfile()->getProfilePhone()) {
         $phone = new \Club\UserBundle\Entity\ProfilePhone();
         $phone->setContactType('home');
         $phone->setProfile($user->getProfile());
         $user->getProfile()->setProfilePhone($phone);
     }
     if (!$user->getProfile()->getProfileEmail()) {
         $email = new \Club\UserBundle\Entity\ProfileEmail();
         $email->setContactType('home');
         $email->setProfile($user->getProfile());
         $user->getProfile()->setProfileEmail($email);
     }
     return $user;
 }
Beispiel #2
0
 /**
  * Remove profile_phones
  *
  * @param Club\UserBundle\Entity\ProfilePhone $profilePhones
  */
 public function removeProfilePhone(\Club\UserBundle\Entity\ProfilePhone $profilePhones)
 {
     $this->profile_phones->removeElement($profilePhones);
 }
 protected function buildUser($user)
 {
     $em = $this->getDoctrine()->getManager();
     if (!count($user->getProfile()->getProfileAddress())) {
         $address = new \Club\UserBundle\Entity\ProfileAddress();
         $address->setProfile($user->getProfile());
         $user->getProfile()->setProfileAddress($address);
     }
     if (!count($user->getProfile()->getProfilePhone())) {
         $phone = new \Club\UserBundle\Entity\ProfilePhone();
         $phone->setProfile($user->getProfile());
         $user->getProfile()->setProfilePhone($phone);
     }
     if (!count($user->getProfile()->getProfileEmail())) {
         $email = new \Club\UserBundle\Entity\ProfileEmail();
         $email->setProfile($user->getProfile());
         $user->getProfile()->setProfileEmail($email);
         $user->getProfile()->addProfileEmail($email);
     }
     return $user;
 }