Exception.php 753 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace Gedmo\Sluggable;
  3. /**
  4. * The exception list for Sluggable behavior
  5. *
  6. * @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
  7. * @package Gedmo.Sluggable
  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 slugIsEmpty()
  15. {
  16. return new self("Sluggable: was unable to find any non empty sluggable fields, make sure they have something at least.");
  17. }
  18. static public function slugFieldIsUnique($slugField)
  19. {
  20. return new self("Sluggable: cannot support unique slug field '{$slugField}' during concurent updates, make an index on it.");
  21. }
  22. }