DB changed.

- Removed RoomCategoryDetails.
- Updated some constraints and fields.
This commit is contained in:
2024-09-09 13:44:18 +02:00
parent 53374dfdfc
commit 09f384fce0
15 changed files with 123 additions and 348 deletions
@@ -33,7 +33,6 @@ class RoomCategoryCrudController extends AbstractCrudController
TextField::new('description'),
TextField::new('bedType'),
IntegerField::new('maxGuestNum'),
CollectionField::new('roomCategoryDetails')->useEntryCrudForm(),
CollectionField::new('roomCategoryPhotos')->useEntryCrudForm()
];
}
@@ -1,24 +0,0 @@
<?php
namespace App\Controller\Admin;
use App\Entity\RoomCategoryDetails;
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
class RoomCategoryDetailsCrudController extends AbstractCrudController
{
public static function getEntityFqcn(): string
{
return RoomCategoryDetails::class;
}
public function configureFields(string $pageName): iterable
{
return [
TextField::new('detailsSection'),
TextField::new('detailValue'),
];
}
}
@@ -5,7 +5,7 @@ namespace App\Controller\Admin;
use App\Entity\RoomCategoryPhoto;
use App\Entity\RoomCategoryPhotoKinds;
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;
use EasyCorp\Bundle\EasyAdminBundle\Field\{TextField, ChoiceField};
use EasyCorp\Bundle\EasyAdminBundle\Field\{TextField, IntegerField};
class RoomCategoryPhotoCrudController extends AbstractCrudController
{
@@ -18,7 +18,7 @@ class RoomCategoryPhotoCrudController extends AbstractCrudController
{
yield TextField::new('path');
yield TextField::new('altText');
yield ChoiceField::new('kind')->setChoices(['Main' => 'main', 'Bathroom' => 'bathroom', 'Other' => 'other']);
yield IntegerField::new('order');
}
}