MappingException.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace Gedmo\Timestampable\Mapping;
  3. /**
  4. * The mapping exception list for Timestampable behavior
  5. *
  6. * @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
  7. * @package Gedmo.Timestampable.Mapping
  8. * @subpackage MappingException
  9. * @link http://www.gediminasm.org
  10. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  11. */
  12. class MappingException extends \Exception
  13. {
  14. static public function notValidFieldType($field, $class)
  15. {
  16. return new self("Timestampable: field - [{$field}] type is not valid date or time field in class - {$class}");
  17. }
  18. static public function triggerTypeInvalid($field, $class)
  19. {
  20. return new self("Timestampable: field - [{$field}] trigger 'on' is not one of [update, create, change] in class - {$class}");
  21. }
  22. static public function parametersMissing($field, $class)
  23. {
  24. return new self("Timestampable: missing parameters on property - {$field}, field and value must be set on [change] trigger in class - {$class}");
  25. }
  26. static public function fieldMustBeMapped($field, $class)
  27. {
  28. return new self("Timestampable: was unable to find [{$field}] as mapped property in entity - {$class}");
  29. }
  30. }