コード例 #1
0
ファイル: Users.class.php プロジェクト: AmineCherrai/rostanvo
 /**
  * @param $authId
  * @return boolean
  */
 private function isLastUserWithAuthID($authId)
 {
     $guser = new Gpf_Db_User();
     $guser->setAuthId($authId);
     try {
         $guser->loadFromData(array(Gpf_Db_Table_Users::AUTHID));
     } catch (Gpf_Exception $e) {
         return false;
     }
     return true;
 }
コード例 #2
0
	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);
			}
		}
	}
コード例 #3
0
ファイル: User.class.php プロジェクト: AmineCherrai/rostanvo
 private function checkConstraints() {
     try{
         $this->check();
     } catch (Gpf_DbEngine_Row_CheckException $e) {
         $exceptions = array();
         foreach ($e as $constraintExeption) {
             if($constraintExeption instanceof Gpf_DbEngine_Row_PasswordConstraintException && $this->accountUser->getRoleId() == Pap_Application::DEFAULT_ROLE_MERCHANT) {
                 continue;
             }
             $exceptions[] = $constraintExeption;
         }
         if(count($exceptions) > 0) {
             throw new Gpf_DbEngine_Row_CheckException($exceptions);
         }
     }
 }
コード例 #4
0
 private function getAccountUser($authUserId)
 {
     $accountUser = new Gpf_Db_User();
     $accountUser->setAuthId($authUserId);
     try {
         $accountUser->loadFromData(array(Gpf_Db_Table_Users::AUTHID));
     } catch (Exception $e) {
         return null;
     }
     return $accountUser;
 }