本文整理汇总了PHP中Pimcore\Model\Document::getList方法的典型用法代码示例。如果您正苦于以下问题:PHP Document::getList方法的具体用法?PHP Document::getList怎么用?PHP Document::getList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pimcore\Model\Document
的用法示例。
在下文中一共展示了Document::getList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDocumentList
/**
* @param null $condition
* @param null $order
* @param null $orderKey
* @param null $offset
* @param null $limit
* @param null $groupBy
* @throws \Exception
*/
public function getDocumentList($condition = null, $order = null, $orderKey = null, $offset = null, $limit = null, $groupBy = null)
{
try {
$list = Document::getList(array("condition" => $condition, "order" => $order, "orderKey" => $orderKey, "offset" => $offset, "limit" => $limit, "groupBy" => $groupBy));
$list->setUnpublished(1);
$items = array();
/** @var $doc Document */
foreach ($list as $doc) {
$item = new Webservice\Data\Document\Listing\Item();
$item->id = $doc->getId();
$item->type = $doc->getType();
if (method_exists($doc, "getPublished")) {
$item->published = $doc->getPublished();
}
$items[] = $item;
}
return $items;
} catch (\Exception $e) {
\Logger::error($e);
throw $e;
}
}
示例2: portletModifiedDocumentsAction
public function portletModifiedDocumentsAction()
{
$list = Document::getList(["limit" => 10, "order" => "DESC", "orderKey" => "modificationDate"]);
$response = [];
$response["documents"] = [];
foreach ($list as $doc) {
$response["documents"][] = ["id" => $doc->getId(), "type" => $doc->getType(), "path" => $doc->getRealFullPath(), "date" => $doc->getModificationDate(), "condition" => "userModification = '" . $this->getUser()->getId() . "'"];
}
$this->_helper->json($response);
}