|
| 1 | +<?php |
| 2 | +/** |
| 3 | + * Copyright © Webscale. All rights reserved. |
| 4 | + * See LICENSE for license details. |
| 5 | + */ |
| 6 | + |
| 7 | +namespace Webscale\Varnish\Model\Config\Source; |
| 8 | + |
| 9 | +use Magento\Framework\Data\OptionSourceInterface; |
| 10 | + |
| 11 | +class InvalidateEvents implements OptionSourceInterface |
| 12 | +{ |
| 13 | + /** |
| 14 | + * @var array |
| 15 | + */ |
| 16 | + protected $options; |
| 17 | + |
| 18 | + /** |
| 19 | + * @param bool $isMultiselect |
| 20 | + * @return array |
| 21 | + */ |
| 22 | + public function toOptionArray($isMultiselect = false) |
| 23 | + { |
| 24 | + if (!$this->options) { |
| 25 | + $this->options = [ |
| 26 | + [ |
| 27 | + 'value' => 'clean_cache_by_tags', |
| 28 | + 'label' => 'clean_cache_by_tags' |
| 29 | + ], |
| 30 | + [ |
| 31 | + 'value' => 'assigned_theme_changed', |
| 32 | + 'label' => 'assigned_theme_changed' |
| 33 | + ], |
| 34 | + [ |
| 35 | + 'value' => 'catalogrule_after_apply', |
| 36 | + 'label' => 'catalogrule_after_apply' |
| 37 | + ], |
| 38 | + [ |
| 39 | + 'value' => 'controller_action_postdispatch_adminhtml_system_currency_saveRates', |
| 40 | + 'label' => 'controller_action_postdispatch_adminhtml_system_currency_saveRates' |
| 41 | + ], |
| 42 | + [ |
| 43 | + 'value' => 'controller_action_postdispatch_adminhtml_system_config_save', |
| 44 | + 'label' => 'controller_action_postdispatch_adminhtml_system_config_save' |
| 45 | + ], |
| 46 | + [ |
| 47 | + 'value' => 'controller_action_postdispatch_adminhtml_catalog_product_action_attribute_save', |
| 48 | + 'label' => 'controller_action_postdispatch_adminhtml_catalog_product_action_attribute_save' |
| 49 | + ], |
| 50 | + [ |
| 51 | + 'value' => 'controller_action_postdispatch_adminhtml_catalog_product_massStatus', |
| 52 | + 'label' => 'controller_action_postdispatch_adminhtml_catalog_product_massStatus' |
| 53 | + ], |
| 54 | + [ |
| 55 | + 'value' => 'controller_action_postdispatch_adminhtml_system_currencysymbol_save', |
| 56 | + 'label' => 'controller_action_postdispatch_adminhtml_system_currencysymbol_save' |
| 57 | + ], |
| 58 | + [ |
| 59 | + 'value' => 'clean_cache_after_reindex', |
| 60 | + 'label' => 'clean_cache_after_reindex' |
| 61 | + ], |
| 62 | + [ |
| 63 | + 'value' => 'adminhtml_cache_flush_system', |
| 64 | + 'label' => 'adminhtml_cache_flush_system' |
| 65 | + ], |
| 66 | + ]; |
| 67 | + } |
| 68 | + |
| 69 | + $options = $this->options; |
| 70 | + |
| 71 | + if (!$isMultiselect) { |
| 72 | + array_unshift($options, ['value' => '', 'label' => __('--Please Select--')]); |
| 73 | + } |
| 74 | + |
| 75 | + return $options; |
| 76 | + } |
| 77 | +} |
0 commit comments