Read the section in the Porto SAP Documentation (#Actions).
- All Actions MUST extend
Delete User Action:
Note: instead of passing these parameters
string $email, string $password, string $name, bool $isClient = falsefrom place to another over and over. Consider using the Transporters classes (simple DTO's "Data Transfer Objects"), for more details read the Transporters Page.
Injecting each Task in constructor and then using it below through its property is really boring, and the more Tasks you use the worse it gets. So instead you can use the function
call to call whichever Task you want and then pass any parameters to it.
The Action itself was also called using
Apiato::call() which triggers the
run function in it.
Refer to the Magical Call page for more info and examples on how to use the call function.
Same Example using the
Example: Calling multiple Tasks:
Action usage from a Controller:
The same Action MAY be called by multiple Controllers (Web, Api, Cli).