<?php

namespace AutoAdmin\Bundle\Content\Entity\Duplicators;

use AutoAdmin\Bundle\Media\Model\ImageInterface;

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

    /**
     * @param ImageInterface $entity
     * @param ImageInterface $duplicate
     *
     * @return ImageInterface
     */
    public function duplicate($entity, $duplicate, $parent = null)
    {
        $duplicate->setAlt($entity->getAlt());
        $duplicate->setWidth($entity->getWidth());
        $duplicate->setHeight($entity->getHeight());

        return $duplicate;
    }
}