<?php

namespace AutoAdmin\Bundle\Content\Entity\Duplicators;

use AutoAdmin\Bundle\Content\Model\NameInterface;

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

    /**
     * @param NameInterface $entity
     * @param NameInterface $duplicate
     *
     * @return NameInterface
     */
    public function duplicate($entity, $duplicate, $parent = null)
    {
        $duplicate->setName($entity->getName());

        return $duplicate;
    }
}