<?php
	require_once( $GLOBALS["site_root"] . "/includes/tasks/GeneralTask.inc.php" );
	require_once( $GLOBALS["site_root"] . "/includes/models/Member.inc.php" );

	class MiniMemberDirtyTask extends GeneralTask {

		public function __construct( $task_id , $task_processor ) {
			parent::__construct( $task_id , $task_processor );
		}

		public function processTask() {
			if ($this->task_processor->timeLeft()<3) return false;	// lejar az ido
			$query = sprintf( "select member_id from members where is_dirty" );
			$member_ids = FNTH_db_get_column( $query , "member_id" );
			$mm = new MemberModel();
			foreach ($member_ids as $member_id) {
				if ($this->task_processor->timeLeft()<3) return false;	// lejar az ido
				$mm->refreshMember( $member_id );
			}
			return true;
		}
	}
?>
