Skip to content
This repository was archived by the owner on Sep 8, 2019. It is now read-only.

onProcess

Lubomir Andrisek edited this page Apr 18, 2019 · 1 revision

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);
    }

Clone this wiki locally