public function unregisterNotifications($session, $notificationId){ $this->loginFromSession($session); $notificationRegistration = new Gpf_Db_NotificationRegistration(); $notificationRegistration->setNotificationId($notificationId); $notificationRegistration->delete(); return new Pap_Mobile_Response(true); }
private function createNotificationsForSale($saleRow) { $notificationRegistrationRow = new Gpf_Db_NotificationRegistration(); $rowCollection = $notificationRegistrationRow->loadCollection(); foreach ($rowCollection as $notificationRegistrationRow) { $accountUserId = $notificationRegistrationRow->getAccountUserId(); $notificationId = $notificationRegistrationRow->getNotificationId(); $clientType = $notificationRegistrationRow->getClientType(); $user = new Gpf_Db_User(); $user->setId($accountUserId); $user->load(); $isMerchant = $user->getRoleId() == 'pap_merc'; if ($isMerchant || $accountUserId == $saleRow->get('accountuserid')) { $this->addnotification($clientType, $notificationId, $isMerchant, $saleRow); } } }