<?php

namespace AutoAdmin\Bundle\Content\Duplicator;

use AutoAdmin\Bundle\Content\Model\PublishTimePeriodInterface;

class PublishTimePeriodDuplicator extends AbstractDuplicator
{
    /**
     * @return string[]
     */
    public function supportInterfaces(): array
    {
        return [
            PublishTimePeriodInterface::class
        ];
    }

    /**
     * @param PublishTimePeriodInterface $entity
     * @param PublishTimePeriodInterface $duplicate
     *
     * @return PublishTimePeriodInterface
     */
    public function duplicate(object $entity, object $duplicate, ?object $parent = null): object
    {
        $duplicate->setPublishStartDate($entity->getPublishStartDate());
        $duplicate->setPublishEndDate($entity->getPublishEndDate());

        return $duplicate;
    }
}
