You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would you be open to the introduction of a repository to make the persistence of models abstract?
I'm not thinking any massively crazy refactor, but basically just a repository that persists (and fetches) the eloquent models, instead of calling save() directly on the model like here
My motivation for this is
Be able to use an in memory repository in my current project during tests
Have an easy way to hook into loading/saving the models for extra metadata
The text was updated successfully, but these errors were encountered:
This is something that I considered and eventually decided against when I first created the package. I'm not opposed to the idea in general, but I think it would require quite a few changes. If the Workflow no longer saves itself, it means that the entire control flow needs to change since something outside the workflow needs to pass it to the repository.
The easiest way to do this might be to have the onJobFinished and onJobFailed methods accept a repository as a parameter and then use that instead of $this->save(). This seems like a rather half-hearted implementation, however.
I didn't have any concrete plans, but the first (naive) idea that sprung to mind was just pulling it from the container like AbstractWorkflow does, but that's pretty nasty too.
I can dig around some more and try some stuff out.
Would you be open to the introduction of a repository to make the persistence of models abstract?
I'm not thinking any massively crazy refactor, but basically just a repository that persists (and fetches) the eloquent models, instead of calling
save()
directly on the model like hereMy motivation for this is
The text was updated successfully, but these errors were encountered: