1 | <?php |
||
13 | class CacheWarmer |
||
14 | { |
||
15 | /** |
||
16 | * The metadata factory for loading and caching metadata objects. |
||
17 | * |
||
18 | * @var MetadataFactory |
||
19 | */ |
||
20 | private $mf; |
||
21 | |||
22 | /** |
||
23 | * Constructor. |
||
24 | * |
||
25 | * @param MetadataFactory $mf |
||
26 | */ |
||
27 | public function __construct(MetadataFactory $mf) |
||
31 | |||
32 | /** |
||
33 | * Clears metadata objects from the cache. |
||
34 | * |
||
35 | * @param string|array|null $type |
||
36 | * @return array |
||
37 | */ |
||
38 | public function clear($type = null) |
||
45 | |||
46 | /** |
||
47 | * Warms up metadata objects into the cache. |
||
48 | * |
||
49 | * @param string|array|null $type |
||
50 | * @return array |
||
51 | */ |
||
52 | public function warm($type = null) |
||
59 | |||
60 | /** |
||
61 | * Clears metadata objects for the provided model types. |
||
62 | * |
||
63 | * @param array $types |
||
64 | * @return array |
||
65 | */ |
||
66 | private function doClear(array $types) |
||
81 | |||
82 | /** |
||
83 | * Warms up the metadata objects for the provided model types. |
||
84 | * |
||
85 | * @param array $types |
||
86 | * @return array |
||
87 | */ |
||
88 | private function doWarm(array $types) |
||
98 | |||
99 | /** |
||
100 | * Gets the model types based on an array, string, or null type value. |
||
101 | * |
||
102 | * @param string|array|null |
||
103 | * @return array |
||
104 | */ |
||
105 | private function getTypes($type = null) |
||
112 | } |
||
113 |