Nelmio\Alice\FixtureBuilder\Denormalizer\Fixture\Chainable\SimpleCollectionDenormalizer::denormalize PHP Method

denormalize() public method

public denormalize ( FixtureBag $builtFixtures, string $className, string $fixtureId, array $specs, FlagBag $flags ) : FixtureBag
$builtFixtures Nelmio\Alice\FixtureBag
$className string
$fixtureId string
$specs array
$flags Nelmio\Alice\Definition\FlagBag
return Nelmio\Alice\FixtureBag
    public function denormalize(FixtureBag $builtFixtures, string $className, string $fixtureId, array $specs, FlagBag $flags) : FixtureBag
    {
        try {
            return $this->collectionDenormalizer->denormalize($builtFixtures, $className, $fixtureId, $specs, $flags);
        } catch (InvalidScopeException $exception) {
            // Continue to fallback on a more conventional way
        }
        if (null === $this->denormalizer) {
            throw DenormalizerExceptionFactory::createDenormalizerNotFoundUnexpectedCall(__METHOD__);
        }
        if (null === $this->parser) {
            throw FlagParserExceptionFactory::createForExpectedMethodToBeCalledIfHasAParser(__METHOD__);
        }
        $flags = $this->parser->parse($fixtureId)->mergeWith($flags, false);
        $fixtureId = $flags->getKey();
        $fixtureIds = $this->buildIds($fixtureId);
        foreach ($fixtureIds as $fixtureId => $valueForCurrent) {
            $builtFixtures = $this->denormalizeFixture($builtFixtures, $className, $fixtureId, $specs, $flags, (string) $valueForCurrent);
        }
        return $builtFixtures;
    }