<?php

namespace AutoAdmin\Bundle\Content\Duplicator;

use AutoAdmin\Bundle\Content\Model\SlugInterface;

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

    /**
     * @param SlugInterface $entity
     * @param SlugInterface $duplicate
     *
     * @return SlugInterface
     */
    public function duplicate(object $entity, object $duplicate, ?object $parent = null): object
    {
        $duplicate->setSlug($this->appendSlugSuffix($entity->getSlug()));

        return $duplicate;
    }
}
