Timestampable.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. * @package Gedmo.Timestampable
  10. * @subpackage Timestampable
  11. * @link http://www.gediminasm.org
  12. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  13. */
  14. interface Timestampable
  15. {
  16. // timestampable expects annotations on properties
  17. /**
  18. * @gedmo:Timestampable(on="create")
  19. * dates which should be updated on insert only
  20. */
  21. /**
  22. * @gedmo:Timestampable(on="update")
  23. * dates which should be updated on update and insert
  24. */
  25. /**
  26. * @gedmo:Timestampable(on="change", field="field", value="value")
  27. * dates which should be updated on changed "property"
  28. * value and become equal to given "value"
  29. */
  30. /**
  31. * example
  32. *
  33. * @gedmo:Timestampable(on="create")
  34. * @Column(type="date")
  35. * $created
  36. */
  37. }