<?php

namespace AutoAdmin\Bundle\Content\Entity\Duplicators;

use AutoAdmin\Bundle\Content\Model\StatePublishableInterface;

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

    /**
     * @param StatePublishableInterface $entity
     * @param StatePublishableInterface $duplicate
     *
     * @return StatePublishableInterface
     */
    public function duplicate($entity, $duplicate, $parent = null)
    {
        $duplicate->setState($entity->getState());

        return $duplicate;
    }
}