public function getIosDevice()
 {
     $this->__load();
     return parent::getIosDevice();
 }
예제 #2
0
 /**
  * @deprecated Use Notification\AndroidEndpoint instead (Amazon SNS integration)
  */
 public function removeDeviceTokens(User $user)
 {
     if (!$user->getIosDevice() && !$user->getAndroidDevice()) {
         return;
     }
     $qb = $this->getEntityManager()->createQueryBuilder();
     $qb->update('CivixCoreBundle:User', 'u');
     if ($user->getIosDevice()) {
         $qb->set('u.iosDevice', 'NULL')->where('u.iosDevice = :token')->setParameter('token', $user->getIosDevice());
     } elseif ($user->getAndroidDevice()) {
         $qb->set('u.androidDevice', 'NULL')->where('u.androidDevice = :token')->setParameter('token', $user->getAndroidDevice());
     }
     return $qb->getQuery()->execute();
 }