当前位置: 首页>>代码示例>>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;未经允许,请勿转载。