Skip to content
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

Automagic created_at and updated_at #151

Closed
rrjanbiah opened this issue Dec 9, 2016 · 3 comments
Closed

Automagic created_at and updated_at #151

rrjanbiah opened this issue Dec 9, 2016 · 3 comments
Assignees

Comments

@rrjanbiah
Copy link

rrjanbiah commented Dec 9, 2016

Provide support for automagic as in Rails

These are calculated/automatic added fields:

  • created_at auto insert
  • updated_at auto update

If these are already possible using callbacks, please provide some hints.

If you provide some guideline/hints, I'll try to provide PR.

@mevdschee mevdschee self-assigned this Dec 9, 2016
@mevdschee
Copy link
Owner

mevdschee commented Dec 9, 2016

Maybe we can have a callback that allows you to add calculated fields? Would that work for you for created_at, created_by etc..?

@mevdschee mevdschee changed the title Feature request: Support automagic Automagic created_at and updated_at Dec 9, 2016
@rrjanbiah
Copy link
Author

@mevdschee Yes, callback should work.

mevdschee added a commit that referenced this issue Mar 12, 2017
mevdschee added a commit that referenced this issue Mar 12, 2017
@mevdschee
Copy link
Owner

mevdschee commented Mar 12, 2017

@rrjanbiah Can you verify that the before handler works for you?

see: https://github.com/mevdschee/php-crud-api/blob/master/tests/tests.php#L37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants