chore: complete update
This commit is contained in:
32
src/Domain/Media/ImageSlotRepository.php
Normal file
32
src/Domain/Media/ImageSlotRepository.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Media;
|
||||
|
||||
use App\Framework\Database\EntityManager;
|
||||
|
||||
final readonly class ImageSlotRepository
|
||||
{
|
||||
public function __construct(
|
||||
private EntityManager $entityManager
|
||||
){}
|
||||
|
||||
public function getSlots(): array
|
||||
{
|
||||
return $this->entityManager->findAll(ImageSlot::class);
|
||||
}
|
||||
|
||||
public function findBySlotName(string $slotName): ImageSlot
|
||||
{
|
||||
return $this->entityManager->findOneBy(ImageSlot::class, ['slot_name' => $slotName]);
|
||||
}
|
||||
|
||||
public function findById(string $id): ImageSlot
|
||||
{
|
||||
return $this->entityManager->find(ImageSlot::class, $id);
|
||||
}
|
||||
|
||||
public function save(ImageSlot $imageSlot): object
|
||||
{
|
||||
return $this->entityManager->save($imageSlot);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user