當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Warehouse::setDisablePaletteLess方法代碼示例

本文整理匯總了PHP中Warehouse::setDisablePaletteLess方法的典型用法代碼示例。如果您正苦於以下問題:PHP Warehouse::setDisablePaletteLess方法的具體用法?PHP Warehouse::setDisablePaletteLess怎麽用?PHP Warehouse::setDisablePaletteLess使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Warehouse的用法示例。


在下文中一共展示了Warehouse::setDisablePaletteLess方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getWarehouses

 /**
  * @return array of warehouses.
  */
 public static function getWarehouses()
 {
     $warehouses = array();
     $sql = "SELECT * FROM " . Database::getTableName('warehouses') . " ORDER BY country ASC, city ASC, name ASC";
     $response = Database::getInstance()->sql('getWarehouses', $sql, '', [], true);
     if (is_array($response)) {
         foreach ($response as $entry) {
             $warehouse = new Warehouse(-1);
             $warehouse->id = $entry['id'];
             $warehouse->name = $entry['name'];
             $warehouse->country = $entry['country'];
             $warehouse->city = $entry['city'];
             $warehouse->setPassword($entry['password']);
             $warehouse->setPasswordRestricted($entry['passwordRestricted']);
             $warehouse->setMail($entry['mail']);
             $warehouse->setDisableLocationLess($entry['disableLocationLess']);
             $warehouse->setDisablePaletteLess($entry['disablePaletteLess']);
             array_push($warehouses, $warehouse);
         }
     }
     return $warehouses;
 }
開發者ID:hanneseilers,項目名稱:Social-Warehouse,代碼行數:25,代碼來源:Warehouse.php

示例2: process

 public function process()
 {
     // check if session is active
     $session = new Session($this->sessionId);
     if ($session->sessionId > 0) {
         // update session
         $session->update();
         // process restricted functions
         switch ($this->f) {
             case 'checkLogin':
                 return Login::checkLogin($session->sessionId);
             case 'getSession':
                 return $session;
             case 'getWarehouse':
                 if (isset($this->data->update)) {
                     $warehouse = new Warehouse($session->warehouseId, $this->data->update);
                 } else {
                     $warehouse = new Warehouse($session->warehouseId);
                 }
                 $warehouse->dMail = $warehouse->getMail();
                 $warehouse->dDisableLocationLess = $warehouse->isLocationLessDisabled();
                 $warehouse->dDisablePaletteLess = $warehouse->isPaletteLessDisabled();
                 return $warehouse;
             case 'editWarehouse':
                 if (!$session->restricted) {
                     $data = $this->data;
                     $warehouse = new Warehouse($session->warehouseId);
                     // update warehouse data
                     if (isset($data->name)) {
                         $warehouse->name = $data->name;
                     }
                     if (isset($data->description)) {
                         $warehouse->description = $data->description;
                     }
                     if (isset($data->country)) {
                         $warehouse->country = $data->country;
                     }
                     if (isset($data->city)) {
                         $warehouse->city = $data->city;
                     }
                     if (isset($data->password)) {
                         $warehouse->setPassword($data->password);
                     }
                     if (isset($data->passwordRestricted)) {
                         $warehouse->setPasswordRestricted($data->passwordRestricted);
                     }
                     if (isset($data->mail)) {
                         $warehouse->setMail($data->mail);
                     }
                     if (isset($data->disableLocationLess)) {
                         $warehouse->setDisableLocationLess($data->disableLocationLess);
                     }
                     if (isset($data->disablePaletteLess)) {
                         $warehouse->setDisablePaletteLess($data->disablePaletteLess);
                     }
                     // update database entry
                     return $warehouse->edit();
                 }
                 break;
             case 'deleteWarehouse':
                 if (!$session->restricted) {
                     $warehouse = new Warehouse($session->warehouseId);
                     if ($warehouse->id > 0 && $warehouse->delete()) {
                         return $session->destroy();
                     }
                 }
                 break;
             case 'addCategory':
                 if (!$session->restricted && isset($this->data->name)) {
                     $category = new Category(null, $session->warehouseId);
                     $category->name = $this->data->name;
                     if (isset($this->data->parent)) {
                         $category->parent = $this->data->parent;
                     }
                     if ($category->edit()) {
                         return $category->id;
                     }
                 }
                 break;
             case 'getCategory':
                 if (isset($this->data->id) && isset($this->data->update)) {
                     return new Category($this->data->id, $session->warehouseId, $this->data->update);
                 } elseif (isset($this->data->id)) {
                     return new Category($this->data->id, $session->warehouseId);
                 }
                 break;
             case 'deleteCategory':
                 if (!$session->restricted && isset($this->data->id)) {
                     $category = new Category($this->data->id, $session->warehouseId);
                     return $category->delete();
                 }
                 break;
             case 'editCategory':
                 if (isset($this->data->id)) {
                     $data = $this->data;
                     $category = new Category($this->data->id, $session->warehouseId);
                     if (!$session->restricted) {
                         if (isset($data->name)) {
                             $category->name = $data->name;
                         }
//.........這裏部分代碼省略.........
開發者ID:hanneseilers,項目名稱:Social-Warehouse,代碼行數:101,代碼來源:DataRequest.php


注:本文中的Warehouse::setDisablePaletteLess方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。