function __construct() { $args = func_get_args(); if (!empty($args)) { parent::__construct($args[0]); $this->timerOptions = array(); if (strtolower(trim($this->getType())) == TIMER_D) { $this->parseTimerLine($this->getElementLine()); $this->rebuildElementLine(); } else { throw new Exception("This is not a timer line!"); } } else { parent::__construct(); $this->setType(TIMER_D); $this->setDaysOfWeek("......."); $this->parseDates("01/01-12/31"); $this->parseStartTime("00:01"); $this->parseStopTime("23:59"); $this->setStartMacro("null"); $this->setStopMacro("null"); $this->timerOptions = array(); $this->rebuildElementLine(); } }
/** * Constructor * * @args[0] represents label, delay and command */ function __construct() { $args = func_get_args(); if (!empty($args)) { parent::__construct($args[0]); if (strtolower(trim($this->getType())) == MACRO_D) { $this->parseMacroLine($this->getElementLine()); $this->rebuildElementLine(); } else { throw new Exception("This is not a macro line!"); } } else { parent::__construct(); $this->setType(MACRO_D); $this->label = 'macro_x'; $this->delay = '0'; $this->command = 'off junk'; $this->rebuildElementLine(); } }
/** * Constructor * * @args[0] represents label (alias or houseUnitCode), command (on/off), execute macro */ function __construct() { $args = func_get_args(); if (!empty($args)) { parent::__construct($args[0]); if (strtolower(trim($this->getType())) == TRIGGER_D) { $this->parseTriggerLine($this->getElementLine()); $this->rebuildElementLine(); } else { throw new Exception("This is not a Trigger line!"); } } else { parent::__construct(); $this->setType(TRIGGER_D); $this->label = 'trigger_x'; $this->command = 'off'; $this->macroLabel = 'junk'; $this->rebuildElementLine(); } }