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:
parent
f8a582d454
commit
787a208708
@ -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.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user