示例#1
0
 public function getDetails($function, $packageObj)
 {
     $dbConnection = PdoUtils::obtainConnection('CMS');
     if ($dbConnection == null) {
         $response = Message::ERROR_NO_DB_CONNECTION;
         $this->errorLog->LogError('PurchaseHistoryController' . json_encode($response));
         return $response;
     }
     $dbConnection->beginTransaction();
     $Contents = array();
     $purchaseHistoryDao = new PurchaseHistoryDao($dbConnection);
     try {
         switch ($function) {
             case 'getPurchaseHistory':
                 $Contents = $purchaseHistoryDao->getPurchaseHistory($packageObj);
                 break;
         }
         $dbConnection->commit();
     } catch (\Exception $e) {
         $dbConnection->rollBack();
         print_r($e->getMessage());
         exit;
     }
     PdoUtils::closeConnection($dbConnection);
     return $Contents;
 }
示例#2
0
 public function getCampaignDetailsByPromoIdByStoreId($promoId, $storeId)
 {
     $dbConnection = PdoUtils::obtainConnection('CAMPAIGN');
     if ($dbConnection == null) {
         return Message::ERROR_NO_DB_CONNECTION;
     }
     $dbConnection->beginTransaction();
     $campaign = null;
     try {
         $campaignDao = new CampaignDao($dbConnection);
         $campaign = $campaignDao->getCampaignDetailsByPromoIdByStoreId($promoId, $storeId);
         $dbConnection->commit();
     } catch (\Exception $e) {
         $dbConnection->rollBack();
         print_r($e);
         exit;
     }
     PdoUtils::closeConnection($dbConnection);
     return $campaign;
 }
示例#3
0
 public function getSubscriptionDetailsPackageIds($packageIds)
 {
     $dbConnection = PdoUtils::obtainConnection('CMS');
     if ($dbConnection == null) {
         return Message::ERROR_NO_DB_CONNECTION;
     }
     $dbConnection->beginTransaction();
     $subscriptions = array();
     try {
         $subscriptionDao = new SubscriptionDao($dbConnection);
         $subscriptions = $subscriptionDao->getSubscriptionDetailsPackageIds($packageIds);
         $dbConnection->commit();
     } catch (\Exception $e) {
         $dbConnection->rollBack();
         echo $e->getMessage();
         exit;
     }
     PdoUtils::closeConnection($dbConnection);
     return $subscriptions;
 }
示例#4
0
 public function getAllPacksByPackageIds($packageIds, $portletIds, $storeId, $templateId)
 {
     $dbConnection = PdoUtils::obtainConnection('CMS');
     if ($dbConnection == null) {
         return Message::ERROR_NO_DB_CONNECTION;
     }
     $dbConnection->beginTransaction();
     $packageDetails = array();
     try {
         $pack = new PackDao($dbConnection);
         $packageDetails = $pack->getAllPacksByPackageIds($packageIds, $portletIds, $storeId, $templateId);
         $dbConnection->commit();
     } catch (\Exception $e) {
         $dbConnection->rollBack();
         print_r($e);
         exit;
     }
     PdoUtils::closeConnection($dbConnection);
     return $packageDetails;
 }
示例#5
0
 public function getMaxVOId()
 {
     $dbConnection = PdoUtils::obtainConnection('CMS');
     if ($dbConnection == null) {
         return Message::ERROR_NO_DB_CONNECTION;
     }
     $dbConnection->beginTransaction();
     $maxVOID = array();
     try {
         $operators = new OperatorsDao($dbConnection);
         $maxVOID = $operators->getMaxVOId();
         $dbConnection->commit();
     } catch (\Exception $e) {
         $dbConnection->rollBack();
         echo $e->getMessage();
         exit;
     }
     PdoUtils::closeConnection($dbConnection);
     return $maxVOID;
 }
示例#6
0
 public function getSubscriptionDetails($function, $subUnsubObj)
 {
     $dbConnection = PdoUtils::obtainConnection('CMS');
     if ($dbConnection == null) {
         return Message::ERROR_NO_DB_CONNECTION;
     }
     $dbConnection->beginTransaction();
     $Contents = array();
     $subUnsub = new SubUnsubDao($dbConnection);
     try {
         switch ($function) {
             case 'unsubscribe':
                 $Contents = $subUnsub->unsubscribe($subUnsubObj);
                 break;
         }
         $dbConnection->commit();
     } catch (\Exception $e) {
         $dbConnection->rollBack();
         print_r($e->getMessage());
         exit;
     }
     PdoUtils::closeConnection($dbConnection);
     return $Contents;
 }
示例#7
0
 public function getAuthDetails($function, $authObj)
 {
     $dbConnection = PdoUtils::obtainConnection('CMS');
     if ($dbConnection == null) {
         return Message::ERROR_NO_DB_CONNECTION;
     }
     $dbConnection->beginTransaction();
     $Contents = array();
     $auth = new AuthDao($dbConnection);
     try {
         switch ($function) {
             case 'getEligibility':
                 $Contents = $auth->getEligibility($authObj);
                 break;
             case 'getUserStatusforSubscription':
                 $Contents = $auth->getUserStatusforSubscription($authObj);
                 break;
             case 'getUserStatusforValuePack':
                 $Contents = $auth->getUserStatusforValuePack($authObj);
                 break;
             case 'getUserStatusforOffer':
                 $Contents = $auth->getUserStatusforOffer($authObj);
                 break;
             case 'getUserStatusforAlacart':
                 $Contents = $auth->getUserStatusforAlacart($authObj);
                 break;
         }
         $dbConnection->commit();
     } catch (\Exception $e) {
         $dbConnection->rollBack();
         print_r($e->getMessage());
         exit;
     }
     PdoUtils::closeConnection($dbConnection);
     return $Contents;
 }
示例#8
0
 public function update()
 {
     $dbConnection = PdoUtils::obtainConnection();
     if ($dbConnection == null) {
         return Message::ERROR_NO_DB_CONNECTION;
     }
     $dbConnection->beginTransaction();
     $result = false;
     try {
         $sessionDao = new SessionDao($dbConnection);
         $result = $sessionDao->update($this);
         $dbConnection->commit();
     } catch (\Exception $e) {
         $dbConnection->rollBack();
         Logger::logException($e);
     }
     PdoUtils::closeConnection($dbConnection);
     return $result;
 }
示例#9
0
 public function getContentDeliveryTypesById($cmdId)
 {
     $dbConnection = PdoUtils::obtainConnection('CMS');
     if ($dbConnection == null) {
         return Message::ERROR_NO_DB_CONNECTION;
     }
     $dbConnection->beginTransaction();
     $contentMetaData = array();
     try {
         $contents = new ContentsDao($dbConnection);
         $contentMetaData = $contents->getContentDeliveryTypesById($cmdId);
         $dbConnection->commit();
     } catch (\Exception $e) {
         $dbConnection->rollBack();
         print_r($e);
         exit;
     }
     PdoUtils::closeConnection($dbConnection);
     return $contentMetaData;
 }
示例#10
0
 public function getTuneID($data)
 {
     $dbConnection = PdoUtils::obtainConnection('CMS');
     if ($dbConnection == null) {
         return Message::ERROR_NO_DB_CONNECTION;
     }
     $dbConnection->beginTransaction();
     $TuneID = array();
     try {
         $tuneDao = new TuneDao($dbConnection);
         $TuneID = $tuneDao->getTuneID($data);
         $dbConnection->commit();
     } catch (\Exception $e) {
         $dbConnection->rollBack();
         print_r($e);
         exit;
     }
     PdoUtils::closeConnection($dbConnection);
     return $TuneID;
 }
示例#11
0
 public function getMetadataStatus($data)
 {
     $dbConnection = PdoUtils::obtainConnection('CMS');
     if ($dbConnection == null) {
         return Message::ERROR_NO_DB_CONNECTION;
     }
     $dbConnection->beginTransaction();
     try {
         $contents = new ContentsDao($dbConnection);
         $isContentMetadataExist = $contents->getMetadataStatus($data);
         $dbConnection->commit();
     } catch (\Exception $e) {
         $dbConnection->rollBack();
         echo $e->getMessage();
         exit;
     }
     PdoUtils::closeConnection($dbConnection);
     return $isContentMetadataExist;
 }
示例#12
0
 public function getMainSitePackageIdsByStoreId($storeId)
 {
     $dbConnection = PdoUtils::obtainConnection('CMS');
     if ($dbConnection == null) {
         return Message::ERROR_NO_DB_CONNECTION;
     }
     $dbConnection->beginTransaction();
     $packageDetails = array();
     try {
         $page = new PageDao($dbConnection);
         $packageDetails = $page->getMainSitePackageIdsByStoreId($storeId);
         $dbConnection->commit();
     } catch (\Exception $e) {
         $dbConnection->rollBack();
         echo $e->getMessage();
         exit;
     }
     PdoUtils::closeConnection($dbConnection);
     return $packageDetails;
 }
示例#13
0
 public function getSubscriptionPricePoints($storeId, $operatorId)
 {
     $dbConnection = PdoUtils::obtainConnection('CMS');
     if ($dbConnection == null) {
         return Message::ERROR_NO_DB_CONNECTION;
     }
     $dbConnection->beginTransaction();
     $storeDetails = array();
     try {
         $store = new StoreDao($dbConnection);
         $CGImagesDetails = $store->getSubscriptionPricePoints($storeId, $operatorId);
         $dbConnection->commit();
     } catch (\Exception $e) {
         $dbConnection->rollBack();
         echo $e->getMessage();
         exit;
     }
     PdoUtils::closeConnection($dbConnection);
     return $CGImagesDetails;
 }
示例#14
0
 public function getContentDownloadPathForAll($data)
 {
     $dbConnection = PdoUtils::obtainConnection('CMS');
     if ($dbConnection == null) {
         return Message::ERROR_NO_DB_CONNECTION;
     }
     $dbConnection->beginTransaction();
     $ContentDownloadPath = null;
     try {
         $contentDownloads = new ContentDownloadDao($dbConnection);
         $ContentDownloadPath = $contentDownloads->getContentDownloadPathForAll($data);
         $dbConnection->commit();
     } catch (\Exception $e) {
         $dbConnection->rollBack();
         print_r($e);
         exit;
     }
     PdoUtils::closeConnection($dbConnection);
     return $ContentDownloadPath;
 }
示例#15
0
 public function getTemplateDetailsByDeviceHeightAndWidth($deviceHeight, $deviceWidth)
 {
     $dbConnection = PdoUtils::obtainConnection('CMS');
     if ($dbConnection == null) {
         return Message::ERROR_NO_DB_CONNECTION;
     }
     $dbConnection->beginTransaction();
     $device = null;
     try {
         $deviceDao = new DeviceDao($dbConnection);
         $device = $deviceDao->getTemplateDetailsByDeviceHeightAndWidth($deviceHeight, $deviceWidth);
         $dbConnection->commit();
     } catch (\Exception $e) {
         $dbConnection->rollBack();
         print_r($e);
         exit;
     }
     PdoUtils::closeConnection($dbConnection);
     return $device;
 }
 public function insertDownloadInfo($data)
 {
     $dbConnection = PdoUtils::obtainConnection('SITE_USER');
     if ($dbConnection == null) {
         return Message::ERROR_NO_DB_CONNECTION;
     }
     $dbConnection->beginTransaction();
     $contentDownloadHistory = null;
     try {
         $contentDownloadHistoryDao = new ContentDownloadHistoryDao($dbConnection);
         $contentDownloadHistory = $contentDownloadHistoryDao->insertDownloadInfo($data);
         $dbConnection->commit();
     } catch (\Exception $e) {
         $dbConnection->rollBack();
         print_r($e);
         exit;
     }
     PdoUtils::closeConnection($dbConnection);
     return $contentDownloadHistory;
 }