Skip to content

Strategies#11

Open
psfpro wants to merge 1 commit intozf-fr:masterfrom
psfpro:master
Open

Strategies#11
psfpro wants to merge 1 commit intozf-fr:masterfrom
psfpro:master

Conversation

@psfpro
Copy link

@psfpro psfpro commented Dec 17, 2015

For example UserHydrator with HydratorStrategy for location

class UserHydrator implements HydratorInterface
{
    protected $hydrator;

    function __construct()
    {
        $hydrator = new ClassMethodsHydrator();
        $hydrator->setStrategy('location', new HydratorStrategy(new LocationHydrator()));

        $this->hydrator = $hydrator;
    }

On hydrate I need get current object and hydrate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant