Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Added map naming strategy for hydrator #6091

Closed
wants to merge 7 commits into from
Closed

Added map naming strategy for hydrator #6091

wants to merge 7 commits into from

Conversation

pszczekutowicz
Copy link

Added naming strategy for hydrator that allows to translate key names from array according to given map.

* @param array $extractMap Map for extract name converion.
* @return \Application\Stdlib\Hydrator\NamingStrategy\MapNamingStrategy
*/
public function setExtractMap($extractMap)
Copy link
Member

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?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setters removed.

@Ocramius
Copy link
Member

Ocramius commented Apr 6, 2014

@pszczekutowicz this strategy seems to deal only with strings, right?

@Ocramius Ocramius added this to the 2.4.0 milestone Apr 6, 2014
@Ocramius Ocramius assigned Ocramius and unassigned Ocramius Apr 6, 2014
@pszczekutowicz
Copy link
Author

@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
@Ocramius
Copy link
Member

Ocramius commented Apr 7, 2014

@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 SplObjectStorage?

* Initialize.
*
* @param array $hydrateMap
* @param array $extractMap
Copy link
Member

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.

weierophinney added a commit that referenced this pull request Apr 14, 2014
Added map naming strategy for hydrator
weierophinney added a commit that referenced this pull request Apr 14, 2014
- Updated docblock parameter names to match signature; added descriptions
weierophinney added a commit that referenced this pull request Apr 14, 2014
@weierophinney
Copy link
Member

Merged to develop for release with 2.4.0.

wdalmut pushed a commit to wdalmut/zf2 that referenced this pull request Apr 24, 2014
- Updated docblock parameter names to match signature; added descriptions
wdalmut pushed a commit to wdalmut/zf2 that referenced this pull request Apr 24, 2014
- Updated docblock parameter names to match signature; added descriptions
freax pushed a commit to freax/zf2 that referenced this pull request Nov 27, 2014
- Updated docblock parameter names to match signature; added descriptions
weierophinney added a commit to zendframework/zend-stdlib that referenced this pull request May 15, 2015
…cz/map-naming-strategy

Added map naming strategy for hydrator
weierophinney added a commit to zendframework/zend-stdlib that referenced this pull request May 15, 2015
- Updated docblock parameter names to match signature; added descriptions
weierophinney added a commit to zendframework/zend-stdlib that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants