Timestampable.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace Gedmo\Timestampable;
  3. /**
  4. * This interface is not necessary but can be implemented for
  5. * Entities which in some cases needs to be identified as
  6. * Timestampable
  7. *
  8. * @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
  9. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  10. */
  11. interface Timestampable
  12. {
  13. // timestampable expects annotations on properties
  14. /**
  15. * @gedmo:Timestampable(on="create")
  16. * dates which should be updated on insert only
  17. */
  18. /**
  19. * @gedmo:Timestampable(on="update")
  20. * dates which should be updated on update and insert
  21. */
  22. /**
  23. * @gedmo:Timestampable(on="change", field="field", value="value")
  24. * dates which should be updated on changed "property"
  25. * value and become equal to given "value"
  26. */
  27. /**
  28. * @gedmo:Timestampable(on="change", field="field")
  29. * dates which should be updated on changed "property"
  30. */
  31. /**
  32. * @gedmo:Timestampable(on="change", fields={"field1", "field2"})
  33. * dates which should be updated if at least one of the given fields changed
  34. */
  35. /**
  36. * example
  37. *
  38. * @gedmo:Timestampable(on="create")
  39. * @Column(type="date")
  40. * $created
  41. */
  42. }