You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 satır
1.9KB

  1. <?php
  2. namespace Lc\CaracoleBundle\Definition\Field\PointSale;
  3. use EasyCorp\Bundle\EasyAdminBundle\Field\ImageField;
  4. use EasyCorp\Bundle\EasyAdminBundle\Field\IntegerField;
  5. use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
  6. use Lc\CaracoleBundle\Field\Address\AddressField;
  7. use Lc\SovBundle\Definition\Field\AbstractFieldDefinition;
  8. use Lc\SovBundle\Field\CKEditorField;
  9. use Lc\SovBundle\Field\ImageManagerField;
  10. use Lc\SovBundle\Field\StatusField;
  11. use Lc\SovBundle\Form\Common\FileUploadType;
  12. class PointSaleFieldDefinition extends AbstractFieldDefinition
  13. {
  14. public function configureIndex(): array
  15. {
  16. return [
  17. 'id',
  18. 'title',
  19. 'status'
  20. ];
  21. }
  22. public function configurePanels(): array
  23. {
  24. return [
  25. 'main',
  26. 'address',
  27. 'seo',
  28. 'conf',
  29. ];
  30. }
  31. public function configurePanelMain(): array
  32. {
  33. return [
  34. 'title',
  35. 'description',
  36. 'status'
  37. ];
  38. }
  39. public function configurePanelAddress(): array
  40. {
  41. return [
  42. 'address'
  43. ];
  44. }
  45. public function configureFields(): array
  46. {
  47. return [
  48. 'id' => IntegerField::new('id')->setSortable(true)->onlyOnIndex(),
  49. 'title' => TextField::new('title')->setSortable(true),
  50. 'code' => TextField::new('code'),
  51. /*'image' => ImageField::new('image')
  52. ->setUploadDir('public/uploads/images/pointsale')
  53. ->setFormType(FileUploadType::class),*/
  54. 'image' => ImageManagerField::new('image'),
  55. 'description' => CKEditorField::new('description'),
  56. 'status' => StatusField::new('status')->setSortable(true),
  57. 'address' => AddressField::new('address')
  58. ->setRequired(true),
  59. ];
  60. }
  61. }