Skip to content

Commit

Permalink
Create the setCustomHydrationMode function
Browse files Browse the repository at this point in the history
This allows multiple hydrators to be set at once, and also allows for
the customHydrationMode options to be set via DoctrineORMModule
  • Loading branch information
Martin Meredith authored and asm89 committed Aug 14, 2012
1 parent f8a582d commit 787a208
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/Doctrine/ORM/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,20 @@ public function setCustomDatetimeFunctions(array $functions)
}
}

/**
* 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.
*
Expand Down

0 comments on commit 787a208

Please sign in to comment.