-
-
Save doctrinebot/0009211af4aa695c99ce to your computer and use it in GitHub Desktop.
Attachments to Doctrine Jira Issue DDC-1412 - https://github.com/doctrine/doctrine2/issues/2036
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Eclipse Workspace Patch 1.0 | |
#P LeezyServer | |
Index: libraries/Doctrine/ORM/Mapping/Driver/DriverChain.php | |
=================================================================== | |
--- libraries/Doctrine/ORM/Mapping/Driver/DriverChain.php (revision 6863) | |
+++ libraries/Doctrine/ORM/Mapping/Driver/DriverChain.php (working copy) | |
@@ -40,6 +40,12 @@ | |
* @var array | |
*/ | |
private $_drivers = array(); | |
+ | |
+ /** | |
+ * @var Driver | |
+ * @author armetiz | |
+ */ | |
+ private $_defaultDriver = null; | |
/** | |
* Add a nested driver. | |
@@ -53,6 +59,28 @@ | |
} | |
/** | |
+ * Set a default driver. | |
+ * | |
+ * @param Driver $defaultDriver | |
+ * @author armetiz | |
+ */ | |
+ public function setDefaultDriver(Driver $defaultDriver) | |
+ { | |
+ $this->_defaultDriver = $defaultDriver; | |
+ } | |
+ | |
+ /** | |
+ * Set a default driver. | |
+ * | |
+ * @return Driver | |
+ * @author armetiz | |
+ */ | |
+ public function getDefaultDriver() | |
+ { | |
+ return $this->_defaultDriver; | |
+ } | |
+ | |
+ /** | |
* Get the array of nested drivers. | |
* | |
* @return array $drivers | |
@@ -76,8 +104,11 @@ | |
return; | |
} | |
} | |
+ | |
+ if ( is_null ( $this->_defaultDriver ) ) | |
+ throw MappingException::classIsNotAValidEntityOrMappedSuperClass($className); | |
- throw MappingException::classIsNotAValidEntityOrMappedSuperClass($className); | |
+ $this->_defaultDriver->loadMetadataForClass($className, $metadata); | |
} | |
/** | |
@@ -119,8 +150,11 @@ | |
return $driver->isTransient($className); | |
} | |
} | |
- | |
+ | |
// class isTransient, i.e. not an entity or mapped superclass | |
- return true; | |
+ if ( is_null ( $this->_defaultDriver ) ) | |
+ return true; | |
+ | |
+ return $this->_defaultDriver->isTransient($className); | |
} | |
} | |
\ No newline at end of file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment