<?php

namespace AutoAdmin\Bundle\Content\Entity\Duplicators;

use AutoAdmin\Bundle\Content\Model\PublishTimePeriodInterface;

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

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

        return $duplicate;
    }
}