當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DaoFactory::getFactory方法代碼示例

本文整理匯總了PHP中DaoFactory::getFactory方法的典型用法代碼示例。如果您正苦於以下問題:PHP DaoFactory::getFactory方法的具體用法?PHP DaoFactory::getFactory怎麽用?PHP DaoFactory::getFactory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DaoFactory的用法示例。


在下文中一共展示了DaoFactory::getFactory方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: sendTradeRegisteredNotification

 function sendTradeRegisteredNotification($tradeObj)
 {
     if ($tradeObj) {
         try {
             //Get target emails
             $userDao = DaoFactory::getFactory()->getUserDao();
             $buyerData = $userDao->getUserByUid($tradeObj->getBuyerUid());
             $sellerData = $userDao->getUserByUid($tradeObj->getSellerUid());
             $enteredByData = $userDao->getUserByUid($tradeObj->getEnteredByUid());
             $object = new stdClass();
             $object->description = $tradeObj->getDescription();
             $object->amount = $tradeObj->getAmount();
             $object->buyerFullLabel = $buyerData['firstname'] . " " . $buyerData['surname'] . " [" . $tradeObj->getBuyerUid() . "]";
             $object->sellerFullLabel = $sellerData['firstname'] . " " . $sellerData['surname'] . " [" . $tradeObj->getSellerUid() . "]";
             $object->enteredByFullLabel = $enteredByData['firstname'] . " " . $enteredByData['surname'] . " [" . $tradeObj->getEnteredByUid() . "]";
             //die(var_dump($object));
             $message = $this->buildHtmlTradeNotification($object);
             //echo "<br>message-->".$message;
             $title = "Intercambio registrado";
             if ($buyerData['email']) {
                 $this->sendEmail($buyerData['email'], $title, $message);
             }
             if ($sellerData['email']) {
                 $this->sendEmail($sellerData['email'], $title, $message);
             }
             $this->sendEmail("bdt.sietepicos@gmail.com", $title, $message);
         } catch (Exception $e) {
             throw new Exception("Email notification problem occured" . $e->getMessage());
         }
     }
 }
開發者ID:jescacena,項目名稱:cispAPI,代碼行數:31,代碼來源:class.MailRestAPI.inc.php

示例2: deleteTradeById

 function deleteTradeById($tradeId)
 {
     $tradeDao = DaoFactory::getFactory()->getTradeDao();
     try {
         $tradeObj = $tradeDao->getTradeById($tradeId);
         $tradeDao->deleteTradeSQL($tradeId);
         //Update seller / buyer credits
         $userDao = DaoFactory::getFactory()->getUserDao();
         $userDao->updateUserCredit($tradeObj['seller']);
         $userDao->updateUserCredit($tradeObj['buyer']);
         return json_encode((object) array(code => 'OK', message => 'Trade successfully removed'));
     } catch (Exception $e) {
         return json_encode((object) array(code => 'KO', message => $e->getMessage()));
     }
 }
開發者ID:jescacena,項目名稱:cispAPI,代碼行數:15,代碼來源:class.CesRestAPI.inc.php


注:本文中的DaoFactory::getFactory方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。