<?php

namespace AutoAdmin\Bundle\Content\Duplicator;

use AutoAdmin\Bundle\Content\Model\TranslationInterface;

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

    /**
     * @param TranslationInterface $entity
     * @param TranslationInterface $duplicate
     *
     * @return TranslationInterface
     */
    public function duplicate(object $entity, object $duplicate, ?object $parent = null): object
    {
        $duplicate->setLocale($entity->getLocale());

        return $duplicate;
    }
}
