From 787a208708ff78527c2a4740e1157bfabd6e9813 Mon Sep 17 00:00:00 2001 From: Martin Meredith Date: Tue, 14 Aug 2012 11:12:10 +0100 Subject: [PATCH] Create the setCustomHydrationMode function This allows multiple hydrators to be set at once, and also allows for the customHydrationMode options to be set via DoctrineORMModule --- lib/Doctrine/ORM/Configuration.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/Doctrine/ORM/Configuration.php b/lib/Doctrine/ORM/Configuration.php index 4abdafcc4..7a3445eae 100644 --- a/lib/Doctrine/ORM/Configuration.php +++ b/lib/Doctrine/ORM/Configuration.php @@ -512,6 +512,20 @@ class Configuration extends \Doctrine\DBAL\Configuration } } + /** + * Set the custom hydrator modes in one pass. + * + * @param array An array of ($modeName => $hydrator) + */ + public function setCustomHydrationModes($modes) + { + $this->_attributes['customHydrationMods'] = array(); + + foreach ($modes as $modeName => $hydrator) { + $this->addCustomHydrationMode($modeName, $hydrator); + } + } + /** * Get the hydrator class for the given hydration mode name. *