-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Added composite hydrator naming strategy #6367
Added composite hydrator naming strategy #6367
Conversation
* | ||
* @param string $name The name of the naming strategy to get. | ||
* | ||
* @throws \Zend\Stdlib\Exception\InvalidArgumentException |
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.
@throws Exception\InvalidArgumentException
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.
Thanks.
I think this PR need to be rebased. |
@ojhaujjwal could you add a blurb to the documentation about how to use this? |
* @throws Exception\InvalidArgumentException | ||
* @return NamingStrategyInterface | ||
*/ | ||
public function get($name) |
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.
I would get rid of all these getters/setters as per discussion on the other PRs :-)
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.
Yes. I will!
Re-checked this: needs to be refactored in following API IMO: final class CompositeNamingStrategy
{
public function __construct(array $strategies, NamingStrategyInterface $defaultStrategy = null) { /* ... */ }
public function hydrate(...) { /**/ }
public function extract(...) { /**/ }
} |
* Zend Framework (http://framework.zend.com/) | ||
* | ||
* @link http://github.com/zendframework/zf2 for the canonical source repository | ||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) |
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.
2015 ;)
9aa4ea2
to
b3ac9fa
Compare
b3ac9fa
to
76dc234
Compare
@Ocramius Done! |
…`defaultNamingStrategy` if no strategy was found
@ojhaujjwal merged, thanks! Please note that I also introduced a new
|
…sed in `$strategies`
…gy` as per specification
… as a default value for the `$defaultNamingStrategy`
… logic by always using the `defaultNamingStrategy` if no strategy was found
…ator-naming-strategy' into develop Close zendframework/zendframework#6367
This naming strategy allows us to use different naming strategy for different property.