ui
ui copied to clipboard
UserAction StepExecutor improvement
Fix #1680 Fix #1681
- Refactor in order to improve Class extension;
- Allow settings Data\UserAction argument from a Data\Model
- arguments can be validate using Model validation.
Question:
Will you be ok to add a property to Model\UserAction say $argModel
instead of using a special key name '__atk_model' in args array?
Then executor can check for both UserAction property ($arg and $argModel) accordingly.
Question: Will you be ok to add a property to Model\UserAction say
$argModel
instead of using a special key name '__atk_model' in args array?Then executor can check for both UserAction property ($arg and $argModel) accordingly.
~If Model\UserAction::$args
can be replaced with a Model, I would prefer that as otherwise args are passed like ...$args
which has no typing check neither correct arg names/order/count.~
I think lets use/stay with __atk_model
for now as the args are not refactorable currently anyway. Maybe add it as a const to Model\UserAction
class prefixed with the cl. name as other constants.
I am currently checking passing the entire $argModel to callback function as well instead of passing $args separately. This will allow full usage of Model capability for action argument i.e usage of hook within the model.
@ibelar how does this PR fix https://github.com/atk4/ui/issues/1680 and what do actaully mean by
Current implementation does not allow for easily overriding each step method
as described in the issue desc?