summaryrefslogtreecommitdiff
path: root/framework/TService.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/TService.php')
-rw-r--r--framework/TService.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/framework/TService.php b/framework/TService.php
index 5df31534..ec91c43a 100644
--- a/framework/TService.php
+++ b/framework/TService.php
@@ -27,6 +27,10 @@ abstract class TService extends TApplicationComponent implements IService
* @var string service id
*/
private $_id;
+ /**
+ * @var boolean whether the service is enabled
+ */
+ private $_enabled=true;
/**
* Initializes the service and attaches {@link run} to the RunService event of application.
@@ -54,6 +58,22 @@ abstract class TService extends TApplicationComponent implements IService
}
/**
+ * @return boolean whether the service is enabled
+ */
+ public function getEnabled()
+ {
+ return $this->_enabled;
+ }
+
+ /**
+ * @param boolean whether the service is enabled
+ */
+ public function setEnabled($value)
+ {
+ $this->_enabled=TPropertyValue::ensureBoolean($value);
+ }
+
+ /**
* Runs the service.
*/
public function run()