TYPO3 CMS  TYPO3_6-2
AbstractPreset.php
Go to the documentation of this file.
1 <?php
3 
18 
22 abstract class AbstractPreset implements PresetInterface {
23 
28  protected $configurationManager = NULL;
29 
33  protected $name = '';
34 
38  protected $priority = 50;
39 
43  protected $configurationValues = array();
44 
48  protected $postValues = array();
49 
56  public function setPostValues(array $postValues) {
57  $this->postValues = $postValues;
58  }
59 
65  public function getIsAvailable() {
66  return $this->isAvailable();
67  }
68 
74  public function isActive() {
75  $isActive = TRUE;
76  foreach ($this->configurationValues as $configurationKey => $configurationValue) {
77  try {
78  $currentValue = $this->configurationManager->getConfigurationValueByPath($configurationKey);
79  } catch (\RuntimeException $e) {
80  $currentValue = NULL;
81  }
82  if ($currentValue !== $configurationValue) {
83  $isActive = FALSE;
84  break;
85  }
86  }
87  return $isActive;
88  }
89 
95  public function getIsActive() {
96  return $this->isActive();
97  }
98 
104  public function getName() {
105  return $this->name;
106  }
107 
113  public function getPriority() {
114  return $this->priority;
115  }
116 
122  public function getConfigurationValues() {
124  }
125 }