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


PHP Asset::getList方法代碼示例

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


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

示例1: portletModifiedAssetsAction

 public function portletModifiedAssetsAction()
 {
     $list = Asset::getList(["limit" => 10, "order" => "DESC", "orderKey" => "modificationDate"]);
     $response = [];
     $response["assets"] = [];
     foreach ($list as $doc) {
         $response["assets"][] = ["id" => $doc->getId(), "type" => $doc->getType(), "path" => $doc->getRealFullPath(), "date" => $doc->getModificationDate(), "condition" => "userModification = '" . $this->getUser()->getId() . "'"];
     }
     $this->_helper->json($response);
 }
開發者ID:solverat,項目名稱:pimcore,代碼行數:10,代碼來源:PortalController.php

示例2: getAssetList

 /**
  * @param null $condition
  * @param null $order
  * @param null $orderKey
  * @param null $offset
  * @param null $limit
  * @param null $groupBy
  * @throws \Exception
  */
 public function getAssetList($condition = null, $order = null, $orderKey = null, $offset = null, $limit = null, $groupBy = null)
 {
     try {
         $params = array();
         if (!empty($condition)) {
             $params["condition"] = $condition;
         }
         if (!empty($order)) {
             $params["order"] = $order;
         }
         if (!empty($orderKey)) {
             $params["orderKey"] = $orderKey;
         }
         if (!empty($offset)) {
             $params["offset"] = $offset;
         }
         if (!empty($limit)) {
             $params["limit"] = $limit;
         }
         if (!empty($groupBy)) {
             $params["groupBy"] = $groupBy;
         }
         $list = Asset::getList($params);
         $items = array();
         foreach ($list as $asset) {
             $item = new Webservice\Data\Asset\Listing\Item();
             $item->id = $asset->getId();
             $item->type = $asset->getType();
             $items[] = $item;
         }
         return $items;
     } catch (\Exception $e) {
         \Logger::error($e);
         throw $e;
     }
 }
開發者ID:pawansgi92,項目名稱:pimcore2,代碼行數:45,代碼來源:Service.php

示例3: getFolderContentPreviewAction

 public function getFolderContentPreviewAction()
 {
     $folder = Asset::getById($this->getParam("id"));
     $start = 0;
     $limit = 10;
     if ($this->getParam("limit")) {
         $limit = $this->getParam("limit");
     }
     if ($this->getParam("start")) {
         $start = $this->getParam("start");
     }
     $condition = "path LIKE '" . ($folder->getFullPath() == "/" ? "/%'" : $folder->getFullPath() . "/%'") . " AND type != 'folder'";
     $list = Asset::getList(array("condition" => $condition, "limit" => $limit, "offset" => $start, "orderKey" => "filename", "order" => "asc"));
     $assets = array();
     foreach ($list as $asset) {
         $thumbnailMethod = "";
         if ($asset instanceof Asset\Image) {
             $thumbnailMethod = "getThumbnail";
         } else {
             if ($asset instanceof Asset\Video && \Pimcore\Video::isAvailable()) {
                 $thumbnailMethod = "getImageThumbnail";
             } else {
                 if ($asset instanceof Asset\Document && \Pimcore\Document::isAvailable()) {
                     $thumbnailMethod = "getImageThumbnail";
                 }
             }
         }
         if (!empty($thumbnailMethod)) {
             $assets[] = array("id" => $asset->getId(), "type" => $asset->getType(), "filename" => $asset->getFilename(), "url" => "/admin/asset/get-" . $asset->getType() . "-thumbnail/id/" . $asset->getId() . "/treepreview/true", "idPath" => $data["idPath"] = Element\Service::getIdPath($asset));
         }
     }
     $this->_helper->json(array("assets" => $assets, "success" => true, "total" => $list->getTotalCount()));
 }
開發者ID:yonetici,項目名稱:pimcore-coreshop-demo,代碼行數:33,代碼來源:AssetController.php


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