AppPackageConfiguration.php 950 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace ModulesGarden\Servers\ProxmoxCloudVps\Core\App\Packages;
  3. use ModulesGarden\Servers\ProxmoxCloudVps\Packages\WhmcsService\Config\Enum;
  4. abstract class AppPackageConfiguration
  5. {
  6. const PACKAGE_STATUS = 'packageStatus';
  7. const PACKAGE_STATUS_ACTIVE = 'active';
  8. const PACKAGE_STATUS_INACTIVE = 'inactive';
  9. const APP_CONFIGURATION = [];
  10. public function getSuboptionsByCallback($optName = null)
  11. {
  12. $optName = preg_replace('/\s+/', '', $optName);
  13. $fullOptName = $optName . 'GetSubOptions';
  14. if (method_exists($this, $fullOptName))
  15. {
  16. return $this->{$fullOptName}();
  17. }
  18. return false;
  19. }
  20. public function getConfigurableOptionsList()
  21. {
  22. if (method_exists($this, 'getConfigurableOptions'))
  23. {
  24. return $this->getConfigurableOptions();
  25. }
  26. return $this::APP_CONFIGURATION[Enum::CONFIGURABLE_OPTIONS];
  27. }
  28. }