-
Notifications
You must be signed in to change notification settings - Fork 1
onProcess
Lengthy process
$process = new MyGraph implements Impala\IProcess;
$this->builder->process($process);
IProcess interface has 3 base method: prepare, run and done.
IProcess::prepare
To stop processing:
public function done(array $data, IImpalaFactory $impala): array {
$response['Message'] = $this->translatorReposiotry->translate('First do some other action.');
}
IProcess::done
Done method return array with optional values which can overwrite attributes or properties of div which will be displayed after lengthy process is finished, like its label, href or message for standard bootstrap div message. If optional key redirect if filled, grid will be redirected to given destination
Examples
public function done(array $data, IImpalaFactory $impala): array {
return ['label' => $this->translatorRepository->translate('Lengthy process has been finished.')];
}
public function done(array $data, IImpalaFactory $impala): array {
return ['label' => $this->translatorRepository->translate('Please wait. You are being redirected.'),
'redirect' => $this->linkGenerator->link($impala->presenter->getName() . ':action', $parameters);
}