-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add after save callback #86
base: master
Are you sure you want to change the base?
Conversation
Tests needed for the new feature. |
Where can I find the .sqlite file ? |
What sqlite file? If you are referring to the test suite it uses an in memory sqlite db by default, no file. |
Thank you for the information. |
@it-mob |
@saeideng |
I added the tests but I don't understand the error of PHPSTAN during the CI tests |
probably something that fixed in phpstan and now should not be this error in ignore list |
Thank you for the answer. I pushed my changes |
Hello, |
Sorry for the delay, I'll review the changes soon. |
src/Model/Endpoint.php
Outdated
$event = $this->dispatchEvent('Model.afterSave', compact('resource', 'options')); | ||
|
||
if ($event->isStopped()) { | ||
return $event->result; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change this to $event->getResult()
.
Thank you for the answer. |
Hello, I just made a new commit with before & after delete callbacks but I have errors with Travis. Thank you. |
Hello, |
Sorry, I had forgotten about this. NVM the phpcs issue. I can take care of it. But I am now leaning towards targeting this enhancement to the |
When an API returns a different result than the submitted data, we use "AfterSave" callback to catch this result