<?php

namespace KupShop\FeedsBundle\Wrapper;

use KupShop\FeedGeneratorBundle\Utils\Map;
use KupShop\FeedsBundle\Utils\FeedUtils;

class SectionWrapperFactory implements IWrapperFactory
{
    /** @var Map */
    protected $map;

    /** @var FeedUtils */
    protected $feedUtils;

    public function __construct(?Map $map, FeedUtils $feedUtils)
    {
        $this->map = $map;
        $this->feedUtils = $feedUtils;
    }

    public function create(bool $isAncestor = false): BaseWrapper
    {
        return new SectionWrapper($this->map, $this, $this->feedUtils, $isAncestor);
    }
}
