当前位置: 首页>>代码示例>>PHP>>正文


PHP Pack::getAllPacksByPackageIds方法代码示例

本文整理汇总了PHP中Pack::getAllPacksByPackageIds方法的典型用法代码示例。如果您正苦于以下问题:PHP Pack::getAllPacksByPackageIds方法的具体用法?PHP Pack::getAllPacksByPackageIds怎么用?PHP Pack::getAllPacksByPackageIds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Pack的用法示例。


在下文中一共展示了Pack::getAllPacksByPackageIds方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getPageDetails

 public function getPageDetails($request)
 {
     $json = json_encode($request->parameters);
     $page = new Page();
     $jsonObj = json_decode($json);
     $jsonMessage = $page->validateJson($jsonObj);
     if ($jsonMessage != Message::SUCCESS) {
         $response = array("status" => "ERROR", "status_code" => '400', 'msgs' => $jsonMessage);
         $this->outputError($response);
         return;
     }
     if (!$page->setValuesFromJsonObj($jsonObj)) {
         $response = array("status" => "ERROR", "status_code" => '400', 'msgs' => Message::ERROR_INVAID_REQUEST_BODY);
         $this->outputError($response);
         return;
     }
     if (trim($page->pageName == '')) {
         $response = array("status" => "ERROR", "status_code" => '400', 'msgs' => Message::ERROR_BLANK_PAGENAME);
         $this->outputError($response);
         return;
     }
     if (trim($page->storeId == '')) {
         $response = array("status" => "ERROR", "status_code" => '400', 'msgs' => Message::ERROR_BLANK_STORE_ID);
         $this->outputError($response);
         return;
     }
     if (trim($page->deviceHeight == '')) {
         $response = array("status" => "ERROR", "status_code" => '400', 'msgs' => Message::ERROR_BLANK_DEVICE_HEIGHT);
         $this->outputError($response);
         return;
     }
     if (trim($page->deviceWidth == '')) {
         $response = array("status" => "ERROR", "status_code" => '400', 'msgs' => Message::ERROR_BLANK_DEVICE_WIDTH);
         $this->outputError($response);
         return;
     }
     $device = new DeviceInfo();
     //$device->dc_height = $page->deviceHeight;
     //$device->dc_width = $page->deviceWidth;
     $templateObj = $device->getTemplateDetailsByDeviceHeightAndWidth($page->deviceHeight, $page->deviceWidth);
     $pageDetails = $page->getPackageIdsByPageName($page->pageName, $page->storeId);
     if (empty($pageDetails)) {
         $response = array("status" => "ERROR", "status_code" => '400', 'msgs' => Message::ERROR_PACKAGE_LOAD);
         $this->outputError($response);
         return;
     } else {
         $portletArray = array();
         $package = new Package();
         $pack = new Pack();
         $vendorsArray = $package->getVendorIdsByStoreId($page->storeId);
         $vendorIds = array();
         if (!empty($vendorsArray)) {
             foreach ($vendorsArray as $vendor) {
                 $vendorIds[] = $vendor['vendor_id'];
             }
             if (!empty($vendorIds)) {
                 $vendorIds = implode(",", $vendorIds);
             }
         }
         foreach ($pageDetails as $pageDetail) {
             if ($pageDetail->packageId > 0 && $pageDetail->portletId > 0) {
                 $portletArray[$pageDetail->portletId]['packageDetails'] = $package->getPortletsWithContentsByPackageIds($pageDetail->packageId, $pageDetail->portletId, $vendorIds);
                 $portletArray[$pageDetail->portletId]['packDetails'] = $pack->getAllPacksByPackageIds($pageDetail->packageId, $pageDetail->portletId, $page->storeId, $templateObj['ct_group_id']);
             }
         }
         $response = array("status" => "SUCCESS-BUSINESS", "status_code" => '200', 'potletMapDetails' => $pageDetails, 'portletDetails' => $portletArray);
         $this->outputSuccess($response);
         return;
     }
 }
开发者ID:sujata-patne,项目名称:icon_api,代码行数:70,代码来源:PageController.php


注:本文中的Pack::getAllPacksByPackageIds方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。