<?php

namespace AutoAdmin\Bundle\Content\Duplicator;

use AutoAdmin\Bundle\Content\Model\NameInterface;

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

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

        return $duplicate;
    }
}
