当前位置: 首页>>代码示例>>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;未经允许,请勿转载。