<?php

namespace AutoAdmin\Bundle\Content\Entity\Duplicators;

use AutoAdmin\Bundle\Content\Model\TranslationInterface;

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

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

        return $duplicate;
    }
}