本文整理汇总了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;
}
}