1 | <?php |
||
38 | class Cache implements CacheConfigurationInterface |
||
39 | { |
||
40 | |||
41 | /** |
||
42 | * The cache type. |
||
43 | * |
||
44 | * @var string |
||
45 | * @Type("string") |
||
46 | * @SerializedName("type") |
||
47 | */ |
||
48 | protected $type; |
||
49 | |||
50 | /** |
||
51 | * The cache's TTL (null === cache item NEVER times out). |
||
52 | * |
||
53 | * @var integer |
||
54 | * @Type("integer") |
||
55 | */ |
||
56 | protected $time = null; |
||
57 | |||
58 | /** |
||
59 | * The event name the listener has to be registered. |
||
60 | * |
||
61 | * @var string |
||
62 | * @Type("boolean") |
||
63 | */ |
||
64 | protected $enabled = true; |
||
65 | |||
66 | /** |
||
67 | * A reference to the parent configuration instance. |
||
68 | * |
||
69 | * @var \TechDivision\Import\ConfigurationInterface |
||
70 | */ |
||
71 | protected $configuration; |
||
72 | |||
73 | /** |
||
74 | * Return's the cache type |
||
75 | * |
||
76 | * @return string The cache type |
||
77 | */ |
||
78 | public function getType() |
||
82 | |||
83 | /** |
||
84 | * Return's the flag whether the cache is enabled or not. |
||
85 | * |
||
86 | * The cache type cache.static is ALWAYS enabled, which is necessary e. g. |
||
87 | * for the registration processor that contains the global data. |
||
88 | * |
||
89 | * @return boolean TRUE if the cache is enabled, else FALSE |
||
90 | */ |
||
91 | public function isEnabled() |
||
95 | |||
96 | /** |
||
97 | * Return's the cache TTL in seconds. |
||
98 | * |
||
99 | * @return integer The TTL |
||
100 | */ |
||
101 | public function getTime() |
||
105 | |||
106 | /** |
||
107 | * Set's the reference to the configuration instance. |
||
108 | * |
||
109 | * @param \TechDivision\Import\ConfigurationInterface $configuration The configuration instance |
||
110 | * |
||
111 | * @return void |
||
112 | */ |
||
113 | public function setConfiguration(ConfigurationInterface $configuration) |
||
117 | |||
118 | /** |
||
119 | * Return's the reference to the configuration instance. |
||
120 | * |
||
121 | * @return \TechDivision\Import\ConfigurationInterface The configuration instance |
||
122 | */ |
||
123 | public function getConfiguration() |
||
127 | } |
||
128 |