<?php

namespace AutoAdmin\Bundle\Content\Entity\Duplicators;

use AutoAdmin\Bundle\Content\Model\SequencedInterface;

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

    /**
     * @param SequencedInterface $entity
     * @param SequencedInterface $duplicate
     *
     * @return SequencedInterface
     */
    public function duplicate($entity, $duplicate, $parent = null)
    {
        $duplicate->setSequence($entity->getSequence());

        return $duplicate;
    }
}