Pimcore\Model\Asset::getList PHP Method

getList() public static method

public static getList ( array $config = [] ) : mixed
$config array
return mixed
    public static function getList($config = [])
    {
        if (is_array($config)) {
            $listClass = "Pimcore\\Model\\Asset\\Listing";
            $list = \Pimcore::getDiContainer()->make($listClass);
            $list->setValues($config);
            $list->load();
            return $list;
        }
    }

Usage Example

Example #1
0
 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);
 }
All Usage Examples Of Pimcore\Model\Asset::getList