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();
}