<?php

namespace AutoAdmin\Bundle\Content\Entity\Duplicators;

use AutoAdmin\Bundle\Content\Model\TitleInterface;

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

    /**
     * @param TitleInterface $entity
     * @param TitleInterface $duplicate
     *
     * @return TitleInterface
     */
    public function duplicate($entity, $duplicate, $parent = null)
    {
        $duplicate->setTitle($entity->getTitle());

        return $duplicate;
    }
}