<?php | |||||
namespace Lc\CaracoleBundle\Controller\Common; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Field\IntegerField; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | |||||
use Lc\ShopBundle\Context\TaxRateInterface; | |||||
use Lc\SovBundle\Controller\Admin\AbstractCrudController; | |||||
class TaxRateCrudController extends AbstractCrudController | |||||
{ | |||||
public static function getEntityFqcn(): string | |||||
{ | |||||
return TaxRateInterface::class; | |||||
} | |||||
public function configureCrud(Crud $crud): Crud | |||||
{ | |||||
return $crud->setSearchFields(['id', 'title', 'value']); | |||||
} | |||||
public function configureFields(string $pageName): iterable | |||||
{ | |||||
$id = IntegerField::new('id', 'ID'); | |||||
$title = TextField::new('title'); | |||||
$value = NumberField::new('value'); | |||||
if (Crud::PAGE_INDEX === $pageName) { | |||||
return [$id, $title, $value]; | |||||
} elseif (Crud::PAGE_DETAIL === $pageName) { | |||||
return [$id, $title, $value]; | |||||
} elseif (Crud::PAGE_NEW === $pageName) { | |||||
return [$title, $value]; | |||||
} elseif (Crud::PAGE_EDIT === $pageName) { | |||||
return [$title, $value]; | |||||
} | |||||
} | |||||
} |
/** | /** | ||||
* @Gedmo\Blameable(on="create") | * @Gedmo\Blameable(on="create") | ||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface") | |||||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface") | |||||
* @ORM\JoinColumn(nullable=true) | * @ORM\JoinColumn(nullable=true) | ||||
*/ | */ | ||||
protected $createdBy; | protected $createdBy; | ||||
/** | /** | ||||
* @Gedmo\Blameable(on="update") | * @Gedmo\Blameable(on="update") | ||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface") | |||||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface") | |||||
* @ORM\JoinColumn(nullable=true) | * @ORM\JoinColumn(nullable=true) | ||||
*/ | */ | ||||
protected $updatedBy; | protected $updatedBy; |
/** | /** | ||||
* @Gedmo\Blameable(on="create") | * @Gedmo\Blameable(on="create") | ||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface") | |||||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface") | |||||
* @ORM\JoinColumn(nullable=true) | * @ORM\JoinColumn(nullable=true) | ||||
*/ | */ | ||||
protected $createdBy; | protected $createdBy; | ||||
/** | /** | ||||
* @Gedmo\Blameable(on="update") | * @Gedmo\Blameable(on="update") | ||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface") | |||||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface") | |||||
* @ORM\JoinColumn(nullable=true) | * @ORM\JoinColumn(nullable=true) | ||||
*/ | */ | ||||
protected $updatedBy; | protected $updatedBy; |
protected $merchant; | protected $merchant; | ||||
/** | /** | ||||
* @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface", mappedBy="newsletters") | |||||
* @ORM\ManyToMany(targetEntity="Lc\SovBundle\Model\User\UserInterface", mappedBy="newsletters") | |||||
*/ | */ | ||||
protected $users; | protected $users; | ||||
protected $merchant; | protected $merchant; | ||||
/** | /** | ||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface", inversedBy="orders", fetch="EAGER") | |||||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface", inversedBy="orders", fetch="EAGER") | |||||
*/ | */ | ||||
protected $user; | protected $user; | ||||
/** | /** | ||||
* @Gedmo\Blameable(on="create") | * @Gedmo\Blameable(on="create") | ||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface") | |||||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface") | |||||
* @ORM\JoinColumn(nullable=true) | * @ORM\JoinColumn(nullable=true) | ||||
*/ | */ | ||||
protected $createdBy; | protected $createdBy; | ||||
/** | /** | ||||
* @Gedmo\Blameable(on="update") | * @Gedmo\Blameable(on="update") | ||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface") | |||||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface") | |||||
* @ORM\JoinColumn(nullable=true) | * @ORM\JoinColumn(nullable=true) | ||||
*/ | */ | ||||
protected $updatedBy; | protected $updatedBy; |
/** | /** | ||||
* @Gedmo\Blameable(on="create") | * @Gedmo\Blameable(on="create") | ||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface") | |||||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface") | |||||
* @ORM\JoinColumn(nullable=true) | * @ORM\JoinColumn(nullable=true) | ||||
*/ | */ | ||||
protected $createdBy; | protected $createdBy; | ||||
/** | /** | ||||
* @Gedmo\Blameable(on="update") | * @Gedmo\Blameable(on="update") | ||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface") | |||||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface") | |||||
* @ORM\JoinColumn(nullable=true) | * @ORM\JoinColumn(nullable=true) | ||||
*/ | */ | ||||
protected $updatedBy; | protected $updatedBy; |
/** | /** | ||||
* @Gedmo\Blameable(on="create") | * @Gedmo\Blameable(on="create") | ||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface") | |||||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface") | |||||
* @ORM\JoinColumn(nullable=true) | * @ORM\JoinColumn(nullable=true) | ||||
*/ | */ | ||||
protected $createdBy; | protected $createdBy; | ||||
/** | /** | ||||
* @Gedmo\Blameable(on="update") | * @Gedmo\Blameable(on="update") | ||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface") | |||||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface") | |||||
* @ORM\JoinColumn(nullable=true) | * @ORM\JoinColumn(nullable=true) | ||||
*/ | */ | ||||
protected $updatedBy; | protected $updatedBy; |
/** | /** | ||||
* @Gedmo\Blameable(on="create") | * @Gedmo\Blameable(on="create") | ||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface") | |||||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface") | |||||
* @ORM\JoinColumn(nullable=true) | * @ORM\JoinColumn(nullable=true) | ||||
*/ | */ | ||||
protected $createdBy; | protected $createdBy; | ||||
/** | /** | ||||
* @Gedmo\Blameable(on="update") | * @Gedmo\Blameable(on="update") | ||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface") | |||||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface") | |||||
* @ORM\JoinColumn(nullable=true) | * @ORM\JoinColumn(nullable=true) | ||||
*/ | */ | ||||
protected $updatedBy; | protected $updatedBy; |
protected $title; | protected $title; | ||||
/** | /** | ||||
* @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface", inversedBy="reductionCredits") | |||||
* @ORM\ManyToMany(targetEntity="Lc\SovBundle\Model\User\UserInterface", inversedBy="reductionCredits") | |||||
*/ | */ | ||||
protected $users; | protected $users; | ||||
protected $sended; | protected $sended; | ||||
/** | /** | ||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface") | |||||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface") | |||||
*/ | */ | ||||
protected $owner; | protected $owner; | ||||
protected $entityAction; | protected $entityAction; | ||||
/** | /** | ||||
* @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface") | |||||
* @ORM\ManyToMany(targetEntity="Lc\SovBundle\Model\User\UserInterface") | |||||
*/ | */ | ||||
protected $users; | protected $users; | ||||
/** | /** | ||||
* @Gedmo\Blameable(on="create") | * @Gedmo\Blameable(on="create") | ||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface") | |||||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface") | |||||
* @ORM\JoinColumn(nullable=true) | * @ORM\JoinColumn(nullable=true) | ||||
*/ | */ | ||||
protected $createdBy; | protected $createdBy; | ||||
/** | /** | ||||
* @Gedmo\Blameable(on="update") | * @Gedmo\Blameable(on="update") | ||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface") | |||||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface") | |||||
* @ORM\JoinColumn(nullable=true) | * @ORM\JoinColumn(nullable=true) | ||||
*/ | */ | ||||
protected $updatedBy; | protected $updatedBy; |
/** | /** | ||||
* @Gedmo\Blameable(on="create") | * @Gedmo\Blameable(on="create") | ||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface") | |||||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface") | |||||
* @ORM\JoinColumn(nullable=true) | * @ORM\JoinColumn(nullable=true) | ||||
*/ | */ | ||||
protected $createdBy; | protected $createdBy; | ||||
/** | /** | ||||
* @Gedmo\Blameable(on="update") | * @Gedmo\Blameable(on="update") | ||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface") | |||||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface") | |||||
* @ORM\JoinColumn(nullable=true) | * @ORM\JoinColumn(nullable=true) | ||||
*/ | */ | ||||
protected $updatedBy; | protected $updatedBy; | ||||
protected $ticketMessages; | protected $ticketMessages; | ||||
/** | /** | ||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface", inversedBy="tickets") | |||||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface", inversedBy="tickets") | |||||
*/ | */ | ||||
protected $user; | protected $user; | ||||
protected $merchant; | protected $merchant; | ||||
/** | /** | ||||
* @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface", mappedBy="groupUsers") | |||||
* @ORM\ManyToMany(targetEntity="Lc\SovBundle\Model\User\UserInterface", mappedBy="groupUsers") | |||||
*/ | */ | ||||
protected $users; | protected $users; | ||||
abstract class UserMerchantModel implements FilterMerchantInterface | abstract class UserMerchantModel implements FilterMerchantInterface | ||||
{ | { | ||||
/** | /** | ||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface", inversedBy="userMerchants") | |||||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface", inversedBy="userMerchants") | |||||
* @ORM\JoinColumn(nullable=false) | * @ORM\JoinColumn(nullable=false) | ||||
*/ | */ | ||||
protected $user; | protected $user; |
abstract class UserPointSaleModel | abstract class UserPointSaleModel | ||||
{ | { | ||||
/** | /** | ||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface", inversedBy="userPointSales") | |||||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface", inversedBy="userPointSales") | |||||
* @ORM\JoinColumn(nullable=false) | * @ORM\JoinColumn(nullable=false) | ||||
*/ | */ | ||||
protected $user; | protected $user; |