Create the setCustomHydrationMode function #424

Closed
wants to merge 3 commits into
from

Projects

None yet

4 participants

@Mezzle

This allows multiple hydrators to be set at once, and also allows for
the customHydrationMode options to be set via DoctrineORMModule

Martin Meredith 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
d8ff7ce
@travisbot

This pull request fails (merged d8ff7ce into f8a582d).

@Ocramius Ocramius and 1 other commented on an outdated diff Aug 14, 2012
lib/Doctrine/ORM/Configuration.php
@@ -513,6 +513,18 @@ public function setCustomDatetimeFunctions(array $functions)
}
/**
+ * Set the custom hydrator modes in one pass.
+ *
+ * @param array An array of ($modeName => $hydrator)
+ */
+ public function setCustomHydrationMode($modes)
@Ocramius
Ocramius Aug 14, 2012

Method should have plural name if you set multiple names

@Ocramius Ocramius commented on an outdated diff Aug 14, 2012
lib/Doctrine/ORM/Configuration.php
@@ -513,6 +513,18 @@ public function setCustomDatetimeFunctions(array $functions)
}
/**
+ * Set the custom hydrator modes in one pass.
+ *
+ * @param array An array of ($modeName => $hydrator)
+ */
+ public function setCustomHydrationMode($modes)
+ {
+ foreach ($modes as $modeName, $hydrator) {
@Ocramius
Ocramius Aug 14, 2012

I'd reset the Hydration modes here eventually. Otherwise rename the method to addCustomHydrationModes

@Ocramius Ocramius commented on an outdated diff Aug 14, 2012
lib/Doctrine/ORM/Configuration.php
@@ -513,6 +513,18 @@ public function setCustomDatetimeFunctions(array $functions)
}
/**
+ * Set the custom hydrator modes in one pass.
+ *
+ * @param array An array of ($modeName => $hydrator)
+ */
+ public function setCustomHydrationModes($modes)
+ {
+ foreach ($modes as $modeName, $hydrator) {
@Ocramius
Ocramius Aug 14, 2012

Syntax error?

@travisbot

This pull request fails (merged 56041e4 into f8a582d).

Martin Meredith Fixup syntax error + reset hydration modes
 * Fixed up a syntax error
 * Reset Custom Hydration modes on calling setCustomHydrationModes
0b61401
@travisbot

This pull request passes (merged 0b61401 into f8a582d).

@asm89
Doctrine member

Sqaushed and merged here: 787a208

@asm89 asm89 closed this Aug 14, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment