isActive; } public static function setActive($state){ $model = static::getModel(); $model->isActive = $state; GlobalVariables::get("dao")->save($model); } protected static function getModel(){ $dao = GlobalVariables::get("dao"); $model = $dao->getFirst("TaskModel",array("name"=>static::getName())); if (is_null($model)){ $saveable = array(); $saveable["name"] = static::getName(); $model = new TaskModel($saveable); } return $model; } } ?>