Nelmio\Alice\Generator\HydratorInterface::hydrate PHP Method

hydrate() public method

Hydrates the given object. Has access to the current fixture set and returns the new fixture set containing the hydrated object.
public hydrate ( Nelmio\Alice\ObjectInterface $object, ResolvedFixtureSet $fixtureSet, GenerationContext $context ) : ResolvedFixtureSet
$object Nelmio\Alice\ObjectInterface Object to hydrate
$fixtureSet ResolvedFixtureSet
$context GenerationContext
return ResolvedFixtureSet
    public function hydrate(ObjectInterface $object, ResolvedFixtureSet $fixtureSet, GenerationContext $context) : ResolvedFixtureSet;

Usage Example

Beispiel #1
0
 private function completeObject(FixtureInterface $fixture, ResolvedFixtureSet $set, GenerationContext $context) : ResolvedFixtureSet
 {
     $instantiatedObject = $set->getObjects()->get($fixture);
     $set = $this->hydrator->hydrate($instantiatedObject, $set, $context);
     $hydratedObject = $set->getObjects()->get($fixture);
     return $this->caller->doCallsOn($hydratedObject, $set);
 }
HydratorInterface