Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Moving exception throwing for invalid file mappings to Doctrine\Commo…

…n\Persistence\Mapping\Driver\FileDriver
  • Loading branch information...
commit ccace8cb8bbfe0ef49e336c1f4e81ba4272879ac 1 parent 03fb734
@Ocramius Ocramius authored
View
16 lib/Doctrine/ORM/Mapping/Driver/AbstractFileDriver.php
@@ -41,20 +41,4 @@
*/
abstract class AbstractFileDriver extends FileDriver implements Driver
{
- /**
- * Get the element of schema meta data for the class from the mapping file.
- * This will lazily load the mapping file if it is not loaded yet
- *
- * @return array $element The element of schema meta data
- * @throws MappingException
- * @todo move behavior to FileDriver
- */
- public function getElement($className)
- {
- $result = parent::getElement($className);
- if($result === null) {
- throw MappingException::invalidMappingFile($className, str_replace('\\', '.', $className) . $this->locator->getFileExtension());
- }
- return $result;
- }
}
View
7 lib/Doctrine/ORM/Mapping/MappingException.php
@@ -78,11 +78,6 @@ public static function mappingFileNotFound($entityName, $fileName)
return new self("No mapping file found named '$fileName' for class '$entityName'.");
}
- public static function invalidMappingFile($entityName, $fileName)
- {
- return new self("Invalid mapping file '$fileName' for class '$entityName'.");
- }
-
/**
* Exception for invalid property name override.
*
@@ -144,7 +139,7 @@ public static function missingResultSetMappingFieldName($entity, $resultName)
{
return new self('Result set mapping named "'.$resultName.'" in "'.$entity.' requires a field name.');
}
-
+
public static function nameIsMandatoryForSqlResultSetMapping($className)
{
return new self("Result set mapping name on entity class '$className' is not defined.");
View
2  tests/Doctrine/Tests/ORM/Mapping/XmlMappingDriverTest.php
@@ -55,7 +55,7 @@ public function testIdentifierWithAssociationKey()
/**
* @group DDC-1468
*
- * @expectedException Doctrine\ORM\Mapping\MappingException
+ * @expectedException Doctrine\Common\Persistence\Mapping\MappingException
* @expectedExceptionMessage Invalid mapping file 'Doctrine.Tests.Models.Generic.SerializationModel.dcm.xml' for class 'Doctrine\Tests\Models\Generic\SerializationModel'.
*/
public function testInvalidMappingFileException()
View
2  tests/Doctrine/Tests/ORM/Mapping/YamlMappingDriverTest.php
@@ -46,7 +46,7 @@ public function testJoinTablesWithMappedSuperclassForYamlDriver()
/**
* @group DDC-1468
*
- * @expectedException Doctrine\ORM\Mapping\MappingException
+ * @expectedException Doctrine\Common\Persistence\Mapping\MappingException
* @expectedExceptionMessage Invalid mapping file 'Doctrine.Tests.Models.Generic.SerializationModel.dcm.yml' for class 'Doctrine\Tests\Models\Generic\SerializationModel'.
*/
public function testInvalidMappingFileException()
Please sign in to comment.
Something went wrong with that request. Please try again.