-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Added map naming strategy for hydrator #6091
Added map naming strategy for hydrator #6091
Conversation
* @param array $extractMap Map for extract name converion. | ||
* @return \Application\Stdlib\Hydrator\NamingStrategy\MapNamingStrategy | ||
*/ | ||
public function setExtractMap($extractMap) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you avoid the setters or make them protected at least?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setters removed.
@pszczekutowicz this strategy seems to deal only with strings, right? |
@Ocramius you are right, it is only for strings. |
As there is no setter for maps at least one map should be required to instantiate MapNamingStrategy
@pszczekutowicz so this code would fail on non-string values (with notices/warnings) - can you make that part stricter or allow passing in something like an |
* Initialize. | ||
* | ||
* @param array $hydrateMap | ||
* @param array $extractMap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These names should map the argument names.
Added map naming strategy for hydrator
- Updated docblock parameter names to match signature; added descriptions
Merged to develop for release with 2.4.0. |
- Updated docblock parameter names to match signature; added descriptions
- Updated docblock parameter names to match signature; added descriptions
- Updated docblock parameter names to match signature; added descriptions
…cz/map-naming-strategy Added map naming strategy for hydrator
- Updated docblock parameter names to match signature; added descriptions
Added naming strategy for hydrator that allows to translate key names from array according to given map.