5 * @author Qiang Xue <qiang.xue@gmail.com>
6 * @link http://www.pradosoft.com/
7 * @copyright Copyright © 2005-2013 PradoSoft
8 * @license http://www.pradosoft.com/license/
9 * @version $Id: TService.php 3245 2013-01-07 20:23:32Z ctrlaltca $
16 * TService implements the basic methods required by IService and may be
17 * used as the basic class for application services.
19 * @author Qiang Xue <qiang.xue@gmail.com>
20 * @version $Id: TService.php 3245 2013-01-07 20:23:32Z ctrlaltca $
24 abstract class TService extends TApplicationComponent implements IService
27 * @var string service id
31 * @var boolean whether the service is enabled
33 private $_enabled=true;
36 * Initializes the service and attaches {@link run} to the RunService event of application.
37 * This method is required by IService and is invoked by application.
38 * @param TXmlElement module configuration
40 public function init($config)
45 * @return string id of this service
47 public function getID()
53 * @param string id of this service
55 public function setID($value)
61 * @return boolean whether the service is enabled
63 public function getEnabled()
65 return $this->_enabled;
69 * @param boolean whether the service is enabled
71 public function setEnabled($value)
73 $this->_enabled=TPropertyValue::ensureBoolean($value);