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; }
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; }
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; }
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; }
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; }
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; }
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; }
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; }
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; }
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; }
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; }
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; }
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; }
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; }
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; }