<?php

namespace AutoAdmin\Bundle\Content\Duplicator;

use AutoAdmin\Bundle\Content\Duplicator\Enum\StringDuplicateModeEnum;
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
    {
        $duplicate->setName($this->suffixes->duplicate($entity->getName(), StringDuplicateModeEnum::LABEL));

        return $duplicate;
    }
}
