瀏覽代碼

Refactoring repository

feature/ticket
Fab 3 年之前
父節點
當前提交
023bf6a9df
共有 3 個文件被更改,包括 18 次插入11 次删除
  1. +0
    -11
      src/Controller/Config/TaxRateAdminController.php
  2. +16
    -0
      src/Controller/Config/UnitAdminController.php
  3. +2
    -0
      src/Controller/Dashboard/DashboardAdminController.php

+ 0
- 11
src/Controller/Config/TaxRateAdminController.php 查看文件

@@ -3,24 +3,13 @@
namespace App\Controller\Config;

use App\Entity\Config\TaxRate;
use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
use Lc\CaracoleBundle\Controller\Config\TaxRateAdminController as CaracTaxRateAdminController;

class TaxRateAdminController extends CaracTaxRateAdminController
{

public static function getEntityFqcn(): string
{
return TaxRate::class;
}

public function configureFields(string $pageName): iterable
{
return [
TextField::new('title')->setLabel('Titre'),
NumberField::new('value')->setLabel('Valeur'),
];
}

}

+ 16
- 0
src/Controller/Config/UnitAdminController.php 查看文件

@@ -0,0 +1,16 @@
<?php

namespace App\Controller\Config;

use App\Entity\Config\Unit;
use Lc\CaracoleBundle\Controller\Config\UnitAdminController as CaracUnitAdminController;

class UnitAdminController extends CaracUnitAdminController
{

public static function getEntityFqcn(): string
{
return Unit::class;
}

}

+ 2
- 0
src/Controller/Dashboard/DashboardAdminController.php 查看文件

@@ -3,6 +3,7 @@
namespace App\Controller\Dashboard;

use App\Entity\Config\TaxRate;
use App\Entity\Config\Unit;
use App\Entity\Merchant\Merchant;
use App\Entity\Section\Section;
use App\Entity\Site\Page;
@@ -40,6 +41,7 @@ class DashboardAdminController extends CaracDashboardController
MenuItem::linkToCrud('admin_merchant', '', Merchant::class),
MenuItem::linkToCrud('admin_section', '', Section::class),
MenuItem::linkToCrud('admin_tva', '', TaxRate::class),
MenuItem::linkToCrud('admin_unit', '', Unit::class),
]
);


Loading…
取消
儲存