Chris@0: . Chris@0: */ Chris@0: Chris@0: namespace Doctrine\Common\Persistence\Mapping; Chris@0: Chris@0: /** Chris@0: * A MappingException indicates that something is wrong with the mapping setup. Chris@0: * Chris@0: * @since 2.2 Chris@0: */ Chris@0: class MappingException extends \Exception Chris@0: { Chris@0: /** Chris@0: * @param string $className Chris@0: * @param array $namespaces Chris@0: * Chris@0: * @return self Chris@0: */ Chris@0: public static function classNotFoundInNamespaces($className, $namespaces) Chris@0: { Chris@0: return new self("The class '" . $className . "' was not found in the ". Chris@0: "chain configured namespaces " . implode(", ", $namespaces)); Chris@0: } Chris@0: Chris@0: /** Chris@0: * @return self Chris@0: */ Chris@0: public static function pathRequired() Chris@0: { Chris@0: return new self("Specifying the paths to your entities is required ". Chris@0: "in the AnnotationDriver to retrieve all class names."); Chris@0: } Chris@0: Chris@0: /** Chris@0: * @param string|null $path Chris@0: * Chris@0: * @return self Chris@0: */ Chris@0: public static function fileMappingDriversRequireConfiguredDirectoryPath($path = null) Chris@0: { Chris@0: if ( ! empty($path)) { Chris@0: $path = '[' . $path . ']'; Chris@0: } Chris@0: Chris@0: return new self( Chris@0: 'File mapping drivers must have a valid directory path, ' . Chris@0: 'however the given path ' . $path . ' seems to be incorrect!' Chris@0: ); Chris@0: } Chris@0: Chris@0: /** Chris@0: * @param string $entityName Chris@0: * @param string $fileName Chris@0: * Chris@0: * @return self Chris@0: */ Chris@0: public static function mappingFileNotFound($entityName, $fileName) Chris@0: { Chris@0: return new self("No mapping file found named '$fileName' for class '$entityName'."); Chris@0: } Chris@0: Chris@0: /** Chris@0: * @param string $entityName Chris@0: * @param string $fileName Chris@0: * Chris@0: * @return self Chris@0: */ Chris@0: public static function invalidMappingFile($entityName, $fileName) Chris@0: { Chris@0: return new self("Invalid mapping file '$fileName' for class '$entityName'."); Chris@0: } Chris@0: Chris@0: /** Chris@0: * @param string $className Chris@0: * Chris@0: * @return self Chris@0: */ Chris@0: public static function nonExistingClass($className) Chris@0: { Chris@0: return new self("Class '$className' does not exist"); Chris@0: } Chris@0: }