Enable Discovery debug logging for production troubleshooting
- Add DISCOVERY_LOG_LEVEL=debug - Add DISCOVERY_SHOW_PROGRESS=true - Temporary changes for debugging InitializerProcessor fixes on production
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\Media;
|
||||
|
||||
use App\Framework\Database\EntityManager;
|
||||
@@ -8,7 +10,8 @@ final readonly class ImageSlotRepository
|
||||
{
|
||||
public function __construct(
|
||||
private EntityManager $entityManager
|
||||
){}
|
||||
) {
|
||||
}
|
||||
|
||||
public function getSlots(): array
|
||||
{
|
||||
@@ -29,4 +32,48 @@ final readonly class ImageSlotRepository
|
||||
{
|
||||
return $this->entityManager->save($imageSlot);
|
||||
}
|
||||
|
||||
public function findAllWithImages(): array
|
||||
{
|
||||
$slots = $this->entityManager->findAll(ImageSlot::class);
|
||||
|
||||
return array_map(function (ImageSlot $slot) {
|
||||
$image = null;
|
||||
if ($slot->imageId) {
|
||||
$image = $this->entityManager->find(Image::class, $slot->imageId);
|
||||
}
|
||||
|
||||
return ImageSlotView::fromSlot($slot, $image);
|
||||
}, $slots);
|
||||
}
|
||||
|
||||
public function findByIdWithImage(string $id): ImageSlotView
|
||||
{
|
||||
$slot = $this->entityManager->find(ImageSlot::class, $id);
|
||||
|
||||
if (! $slot) {
|
||||
throw new \RuntimeException("ImageSlot with ID {$id} not found");
|
||||
}
|
||||
|
||||
$image = null;
|
||||
if ($slot->imageId) {
|
||||
$image = $this->entityManager->find(Image::class, $slot->imageId);
|
||||
}
|
||||
|
||||
return ImageSlotView::fromSlot($slot, $image);
|
||||
}
|
||||
|
||||
public function updateImageId(string $slotId, string $imageId): void
|
||||
{
|
||||
$slot = $this->findById($slotId);
|
||||
#$slot->imageId = $imageId;
|
||||
|
||||
$slot = new ImageSlot(
|
||||
$slot->id,
|
||||
$slot->slotName,
|
||||
$imageId
|
||||
);
|
||||
|
||||
$this->entityManager->save($slot);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user