Browse Source

Refactoring repository

feature/ticket
Fab 3 years ago
parent
commit
023bf6a9df
3 changed files with 18 additions and 11 deletions
  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 View File

namespace App\Controller\Config; namespace App\Controller\Config;


use App\Entity\Config\TaxRate; 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; use Lc\CaracoleBundle\Controller\Config\TaxRateAdminController as CaracTaxRateAdminController;


class TaxRateAdminController extends CaracTaxRateAdminController class TaxRateAdminController extends CaracTaxRateAdminController
{ {

public static function getEntityFqcn(): string public static function getEntityFqcn(): string
{ {
return TaxRate::class; 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 View File

<?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 View File

namespace App\Controller\Dashboard; namespace App\Controller\Dashboard;


use App\Entity\Config\TaxRate; use App\Entity\Config\TaxRate;
use App\Entity\Config\Unit;
use App\Entity\Merchant\Merchant; use App\Entity\Merchant\Merchant;
use App\Entity\Section\Section; use App\Entity\Section\Section;
use App\Entity\Site\Page; use App\Entity\Site\Page;
MenuItem::linkToCrud('admin_merchant', '', Merchant::class), MenuItem::linkToCrud('admin_merchant', '', Merchant::class),
MenuItem::linkToCrud('admin_section', '', Section::class), MenuItem::linkToCrud('admin_section', '', Section::class),
MenuItem::linkToCrud('admin_tva', '', TaxRate::class), MenuItem::linkToCrud('admin_tva', '', TaxRate::class),
MenuItem::linkToCrud('admin_unit', '', Unit::class),
] ]
); );



Loading…
Cancel
Save