MappingException.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace Gedmo\Tree\Mapping;
  3. /**
  4. * The mapping exception list for Tree behavior
  5. *
  6. * @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
  7. * @package Gedmo.Tree.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 parentFieldNotMappedOrRelated($field, $class)
  15. {
  16. return new self("Tree: was unable to find ancestor/parent child relation through ancestor field - [{$field}] in class - {$class}");
  17. }
  18. static public function missingMetaProperties($fields, $class)
  19. {
  20. return new self("Tree: has detected missing properties: " . implode(', ', $fields) . " in class - {$class}");
  21. }
  22. static public function notValidFieldType($field, $class)
  23. {
  24. return new self("Tree: field - [{$field}] type is not valid and must be 'integer', 'smallint' or 'bigint' in class - {$class}");
  25. }
  26. static public function fieldMustBeMapped($field, $class)
  27. {
  28. return new self("Tree: was unable to find [{$field}] as mapped property in entity - {$class}");
  29. }
  30. }