Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }