<?php

declare(strict_types=1);

namespace App\Repository;

use App\Entity\Image;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;

/** @extends ServiceEntityRepository<Image> */
class ImageRepository extends ServiceEntityRepository
{
    public function __construct(ManagerRegistry $registry)
    {
        parent::__construct($registry, Image::class);
    }

    /** @return Image[] */
    public function findSoftDeleted(): array
    {
        return $this->createQueryBuilder('i')
            ->where('i.deletedAt IS NOT NULL')
            ->getQuery()
            ->getResult();
    }
}
