1
0
mirror of synced 2025-01-18 06:21:40 +03:00

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
This commit is contained in:
Martin Meredith 2012-08-14 11:12:10 +01:00 committed by Alexander
parent f8a582d454
commit 787a208708

View File

@ -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.
*