public function run($data, $id = null) {
		$this->hr();
		$this->out(__d('cake_ldap', 'CakePHP Queue Sync task.'));
		if (empty($data) || !is_array($data)) {
			$data = [];
		}
		$dataDefault = [
			'guid' => null,
		];
		$data += $dataDefault;
		extract($data);

		if (empty($guid)) {
			$queueLength = $this->ExtendQueuedTask->getLengthQueue('SyncEmployee');
			if ($queueLength > 0) {
				$this->out(__d('cake_ldap', 'Found sync task in queue: %d. Skipped.', $queueLength));

				return true;
			}
		}

		$this->Sync->syncInformation($guid, $id);

		return true;
	}
public function run($data, $id = null) {
		$this->hr();
		$this->out(__d('cake_ldap', 'CakePHP Queue Sync task.'));
		if (empty($data) || !is_array($data)) {
			$data = [];
		}
		$dataDefault = [
			'guid' => null,
		];
		$data += $dataDefault;
		extract($data);

		if (empty($guid)) {
			$queueLength = $this->ExtendQueuedTask->getLengthQueue('SyncEmployee');
			if ($queueLength > 0) {
				$this->out(__d('cake_ldap', 'Found sync task in queue: %d. Skipped.', $queueLength));

				return true;
			}
		}

		$this->Sync->syncInformation($guid, $id);

		return true;
	}
public function run ( $ data , $ id = null ) { $ this -> hr ( ) ; $ this -> out ( __d ( 'cake_ldap' , 'CakePHP Queue Sync task.' ) ) ; if ( empty ( $ data ) || ! is_array ( $ data ) ) { $ data = [ ] ; } $ dataDefault = [ 'guid' => null , ] ; $ data += $ dataDefault ; extract ( $ data ) ; if ( empty ( $ guid ) ) { $ queueLength = $ this -> ExtendQueuedTask -> getLengthQueue ( 'SyncEmployee' ) ; if ( $ queueLength > 0 ) { $ this -> out ( __d ( 'cake_ldap' , 'Found sync task in queue: %d. Skipped.' , $ queueLength ) ) ; return true ; } } $ this -> Sync -> syncInformation ( $ guid , $ id ) ; return true ; }
Main function.
Used for synchronization information of employees with Active Directory.

@param array $data The array passed to QueuedTask->createJob()
@param int $id The id of the QueuedTask
@return bool Success
@throws RuntimeException when seconds are 0;
Main function . Used for synchronization information of employees with Active Directory .