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