MappingException.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace Gedmo\Translatable\Mapping;
  3. /**
  4. * The mapping exception list for Translatable behavior
  5. *
  6. * @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
  7. * @package Gedmo.Translatable.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 translationClassNotFound($class)
  15. {
  16. return new self("Translatable: the translation entity class: {$class} was not found.");
  17. }
  18. static public function notValidFieldType($field, $class)
  19. {
  20. return new self("Translatable: cannot translate field - [{$field}] type is not valid and must be 'string' or 'text' in class - {$class}");
  21. }
  22. static public function fieldMustBeMapped($field, $class)
  23. {
  24. return new self("Translatable: was unable to find [{$field}] as mapped property in entity - {$class}");
  25. }
  26. static public function fieldMustNotBeMapped($field, $class)
  27. {
  28. return new self("Translatable: field [{$field}] should not be mapped as column property in entity - {$class}, since it makes no sence");
  29. }
  30. }