<?php

namespace AutoAdmin\Bundle\Content\Duplicator;

use AutoAdmin\Bundle\Media\Model\ImageInterface;

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

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

        return $duplicate;
    }
}
