Pimcore\Cache\Tool\Warming::documents PHP Method

documents() public static method

public static documents ( array $types = null ) : void
$types array
return void
    public static function documents($types = null)
    {
        if (empty($types)) {
            $types = ["page", "snippet", "folder", "link"];
        }
        $list = new Document\Listing();
        $list->setCondition("type IN ('" . implode("','", $types) . "')");
        self::loadToCache($list);
    }

Usage Example

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->enableMaintenanceMode();
     try {
         $types = $this->getArrayOption('types', 'validTypes', 'type', true);
         $documentTypes = $this->getArrayOption('documentTypes', 'validDocumentTypes', 'document type');
         $assetTypes = $this->getArrayOption('assetTypes', 'validAssetTypes', 'asset type');
         $objectTypes = $this->getArrayOption('objectTypes', 'validObjectTypes', 'object type');
     } catch (\InvalidArgumentException $e) {
         $this->writeError($e->getMessage());
         return 1;
     }
     if (in_array('document', $types)) {
         $this->writeWarmingMessage('document', $documentTypes);
         Warming::documents($documentTypes);
     }
     if (in_array('asset', $types)) {
         $this->writeWarmingMessage('asset', $assetTypes);
         Warming::assets($assetTypes);
     }
     if (in_array('object', $types)) {
         $this->writeWarmingMessage('object', $objectTypes);
         Warming::assets($assetTypes);
     }
     $this->disableMaintenanceMode();
 }
All Usage Examples Of Pimcore\Cache\Tool\Warming::documents