|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
-
- namespace Lc\CaracoleBundle\Definition\Field\User;
-
- use EasyCorp\Bundle\EasyAdminBundle\Field\IntegerField;
- use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField;
- use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
- use Lc\CaracoleBundle\Context\MerchantContextTrait;
- use Lc\CaracoleBundle\Field\AssociationField;
- use Lc\SovBundle\Definition\Field\AbstractFieldDefinition;
-
-
-
- class UserMerchantFieldDefinition extends AbstractFieldDefinition
- {
- use MerchantContextTrait;
-
- public function configureIndex(): array
- {
- return [
- 'id',
- 'lastname',
- 'firstname',
- 'email',
- 'credit',
- ];
- }
-
- public function configureForm(): array
- {
- return [
- 'user',
- ];
- }
-
- public function configureFields(): array
- {
-
- return [
- 'id'=> IntegerField::new('id')->onlyOnIndex()->setSortable(true),
- 'lastname'=> TextField::new('user.lastname')->setSortable(true),
- 'firstname'=> TextField::new('user.firstname')->setSortable(true),
- 'email'=> TextField::new('user.email')->setSortable(true),
- 'credit'=> NumberField::new('credit')->setSortable(true)
- ->setTemplatePath('@LcSov/adminlte/crud/field/amount.html.twig')
- ->setCustomOption('appendHtml', '€'),
- 'user'=> AssociationField::new('user'),
-
- ];
- }
-
- }
|