<?php

namespace AutoAdmin\Bundle\Content\Duplicator;

use AutoAdmin\Bundle\Content\Model\PublishableInterface;

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

    /**
     * @param PublishableInterface $entity
     * @param PublishableInterface $duplicate
     *
     * @return PublishableInterface
     */
    public function duplicate(object $entity, object $duplicate): object
    {
        // duplicate and set as not published
        $duplicate->setPublishable(false);

        return $duplicate;
    }
}
