Location: PHPKode > projects > PhpBlock > A9.8/script/tick/crontick.class.php
<?php
class CronTick extends Tick {
	public function __construct($parServerTickNumber, $parRunnable, $parHourInTheDayForRun) {
		parent::__construct($parServerTickNumber, 3600*1000, true);
		$this->hourInTheDayForRun = $parHourInTheDayForRun;
		$this->runnable = $parRunnable;
	}

	public function getName() {
		return $this->runnable->getName();
	}

	public function run() {
		$locHour = date('G');
		Log::info("clock is $locHour hour, tick is at $this->hourInTheDayForRun");
		if($locHour == $this->hourInTheDayForRun) {
			$this->runnable->run();
		}
	}
}
?>
Return current item: PhpBlock