Last active
July 21, 2018 16:31
-
-
Save geomagilles/c7ec68187d0bbe075caabb019d86da29 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Zenaton\Interfaces\WorkflowInterface; | |
use Zenaton\Tasks\Wait; | |
use Zenaton\Traits\Zenatonable; | |
class RequestManagementWorkflow implements WorkflowInterface | |
{ | |
use Zenatonable; | |
protected $request; | |
public function __construct($request) | |
{ | |
$this->request = $request; | |
} | |
public function getId() | |
{ | |
return $this->request->id; | |
} | |
public function handle() | |
{ | |
// wait for moderation | |
$event = (new Wait(RequestModerationEvent::class))->execute(); | |
// if rejected, tell user | |
if ($event->rejected) { | |
(new SendRejectionNotification($this->request, $event->reason))->execute(); | |
return; | |
} | |
... | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment