37 lines
979 B
PHP
37 lines
979 B
PHP
<?php
|
|
|
|
namespace App\Controller\Admin;
|
|
|
|
use App\Entity\RecipeProductLine;
|
|
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
|
|
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;
|
|
use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField;
|
|
use EasyCorp\Bundle\EasyAdminBundle\Field\IdField;
|
|
use EasyCorp\Bundle\EasyAdminBundle\Field\IntegerField;
|
|
|
|
class RecipeProductLineCrudController extends AbstractCrudController
|
|
{
|
|
public static function getEntityFqcn(): string
|
|
{
|
|
return RecipeProductLine::class;
|
|
}
|
|
|
|
public function configureFields(string $pageName): iterable
|
|
{
|
|
$fields = [];
|
|
|
|
switch ($pageName) {
|
|
case Crud::PAGE_INDEX:
|
|
case Crud::PAGE_DETAIL:
|
|
$fields[] = IdField::new('id');
|
|
}
|
|
|
|
$fields[] = IntegerField::new('count');
|
|
$fields[] = AssociationField::new('product');
|
|
$fields[] = AssociationField::new('recipe');
|
|
|
|
return $fields;
|
|
}
|
|
|
|
}
|