Exception.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace Gedmo\Translatable;
  3. /**
  4. * The exception list for Translatable behavior
  5. *
  6. * @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
  7. * @package Gedmo.Translatable
  8. * @subpackage Exception
  9. * @link http://www.gediminasm.org
  10. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  11. */
  12. class Exception extends \Exception
  13. {
  14. static public function undefinedLocale()
  15. {
  16. return new self("Translatable: locale or language cannot be empty and must be set in Translatable\Listener or in the entity");
  17. }
  18. static public function singleIdentifierRequired($entityClass)
  19. {
  20. return new self("Translatable: only a single identifier column is required for the Translatable extension, entity: {$entityClass}.");
  21. }
  22. static public function entityMissingLocaleProperty($field, $className)
  23. {
  24. return new self("Translatable: there is no locale field ({$field}) found on entity: {$className}");
  25. }
  26. static public function failedToInsert()
  27. {
  28. return new self("Translatable: failed to insert new Translation record");
  29. }
  30. }