Procházet zdrojové kódy

Refactoring Model

feature/ticket
Fab před 3 roky
rodič
revize
eda68d00a6
15 změnil soubory, kde provedl 65 přidání a 25 odebrání
  1. +40
    -0
      Controller/Common/TaxRateCrudController.php
  2. +2
    -2
      Model/Credit/CreditHistoryModel.php
  3. +2
    -2
      Model/File/DocumentModel.php
  4. +1
    -1
      Model/Newsletter/NewsletterModel.php
  5. +3
    -3
      Model/Order/OrderShopModel.php
  6. +2
    -2
      Model/Order/OrderStatusHistoryModel.php
  7. +2
    -2
      Model/Product/ProductFamilyModel.php
  8. +2
    -2
      Model/Product/ProductModel.php
  9. +2
    -2
      Model/Reduction/ReductionCreditModel.php
  10. +1
    -1
      Model/Reminder/ReminderModel.php
  11. +2
    -2
      Model/Ticket/TicketMessageModel.php
  12. +3
    -3
      Model/Ticket/TicketModel.php
  13. +1
    -1
      Model/User/GroupUserModel.php
  14. +1
    -1
      Model/User/UserMerchantModel.php
  15. +1
    -1
      Model/User/UserPointSaleModel.php

+ 40
- 0
Controller/Common/TaxRateCrudController.php Zobrazit soubor

@@ -0,0 +1,40 @@
<?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];
}
}
}

+ 2
- 2
Model/Credit/CreditHistoryModel.php Zobrazit soubor

@@ -49,14 +49,14 @@ abstract class CreditHistoryModel extends AbstractLightEntity implements PayoffI

/**
* @Gedmo\Blameable(on="create")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface")
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface")
* @ORM\JoinColumn(nullable=true)
*/
protected $createdBy;

/**
* @Gedmo\Blameable(on="update")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface")
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface")
* @ORM\JoinColumn(nullable=true)
*/
protected $updatedBy;

+ 2
- 2
Model/File/DocumentModel.php Zobrazit soubor

@@ -90,14 +90,14 @@ abstract class DocumentModel extends AbstractFullEntity implements FilterMerchan

/**
* @Gedmo\Blameable(on="create")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface")
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface")
* @ORM\JoinColumn(nullable=true)
*/
protected $createdBy;

/**
* @Gedmo\Blameable(on="update")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface")
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface")
* @ORM\JoinColumn(nullable=true)
*/
protected $updatedBy;

+ 1
- 1
Model/Newsletter/NewsletterModel.php Zobrazit soubor

@@ -20,7 +20,7 @@ abstract class NewsletterModel extends AbstractFullEntity implements FilterMerch
protected $merchant;

/**
* @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface", mappedBy="newsletters")
* @ORM\ManyToMany(targetEntity="Lc\SovBundle\Model\User\UserInterface", mappedBy="newsletters")
*/
protected $users;


+ 3
- 3
Model/Order/OrderShopModel.php Zobrazit soubor

@@ -30,7 +30,7 @@ abstract class OrderShopModel extends AbstractLightEntity implements FilterMerch
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;

@@ -112,14 +112,14 @@ abstract class OrderShopModel extends AbstractLightEntity implements FilterMerch

/**
* @Gedmo\Blameable(on="create")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface")
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface")
* @ORM\JoinColumn(nullable=true)
*/
protected $createdBy;

/**
* @Gedmo\Blameable(on="update")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface")
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface")
* @ORM\JoinColumn(nullable=true)
*/
protected $updatedBy;

+ 2
- 2
Model/Order/OrderStatusHistoryModel.php Zobrazit soubor

@@ -31,14 +31,14 @@ abstract class OrderStatusHistoryModel extends AbstractLightEntity

/**
* @Gedmo\Blameable(on="create")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface")
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface")
* @ORM\JoinColumn(nullable=true)
*/
protected $createdBy;

/**
* @Gedmo\Blameable(on="update")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface")
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface")
* @ORM\JoinColumn(nullable=true)
*/
protected $updatedBy;

+ 2
- 2
Model/Product/ProductFamilyModel.php Zobrazit soubor

@@ -64,14 +64,14 @@ abstract class ProductFamilyModel extends AbstractFullEntity implements ProductP

/**
* @Gedmo\Blameable(on="create")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface")
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface")
* @ORM\JoinColumn(nullable=true)
*/
protected $createdBy;

/**
* @Gedmo\Blameable(on="update")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface")
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface")
* @ORM\JoinColumn(nullable=true)
*/
protected $updatedBy;

+ 2
- 2
Model/Product/ProductModel.php Zobrazit soubor

@@ -25,14 +25,14 @@ abstract class ProductModel extends AbstractLightEntity implements SortableInter

/**
* @Gedmo\Blameable(on="create")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface")
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface")
* @ORM\JoinColumn(nullable=true)
*/
protected $createdBy;

/**
* @Gedmo\Blameable(on="update")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface")
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface")
* @ORM\JoinColumn(nullable=true)
*/
protected $updatedBy;

+ 2
- 2
Model/Reduction/ReductionCreditModel.php Zobrazit soubor

@@ -34,7 +34,7 @@ abstract class ReductionCreditModel extends AbstractLightEntity implements Reduc
protected $title;

/**
* @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface", inversedBy="reductionCredits")
* @ORM\ManyToMany(targetEntity="Lc\SovBundle\Model\User\UserInterface", inversedBy="reductionCredits")
*/
protected $users;

@@ -56,7 +56,7 @@ abstract class ReductionCreditModel extends AbstractLightEntity implements Reduc
protected $sended;

/**
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface")
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface")
*/
protected $owner;


+ 1
- 1
Model/Reminder/ReminderModel.php Zobrazit soubor

@@ -49,7 +49,7 @@ abstract class ReminderModel extends AbstractLightEntity implements FilterMercha
protected $entityAction;

/**
* @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface")
* @ORM\ManyToMany(targetEntity="Lc\SovBundle\Model\User\UserInterface")
*/
protected $users;


+ 2
- 2
Model/Ticket/TicketMessageModel.php Zobrazit soubor

@@ -17,14 +17,14 @@ abstract class TicketMessageModel extends AbstractLightEntity implements StatusI

/**
* @Gedmo\Blameable(on="create")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface")
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface")
* @ORM\JoinColumn(nullable=true)
*/
protected $createdBy;

/**
* @Gedmo\Blameable(on="update")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface")
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface")
* @ORM\JoinColumn(nullable=true)
*/
protected $updatedBy;

+ 3
- 3
Model/Ticket/TicketModel.php Zobrazit soubor

@@ -31,14 +31,14 @@ abstract class TicketModel extends AbstractLightEntity implements FilterMerchant

/**
* @Gedmo\Blameable(on="create")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface")
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface")
* @ORM\JoinColumn(nullable=true)
*/
protected $createdBy;

/**
* @Gedmo\Blameable(on="update")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface")
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface")
* @ORM\JoinColumn(nullable=true)
*/
protected $updatedBy;
@@ -101,7 +101,7 @@ abstract class TicketModel extends AbstractLightEntity implements FilterMerchant
protected $ticketMessages;

/**
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface", inversedBy="tickets")
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface", inversedBy="tickets")
*/
protected $user;


+ 1
- 1
Model/User/GroupUserModel.php Zobrazit soubor

@@ -24,7 +24,7 @@ abstract class GroupUserModel extends AbstractFullEntity implements FilterMercha
protected $merchant;

/**
* @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface", mappedBy="groupUsers")
* @ORM\ManyToMany(targetEntity="Lc\SovBundle\Model\User\UserInterface", mappedBy="groupUsers")
*/
protected $users;


+ 1
- 1
Model/User/UserMerchantModel.php Zobrazit soubor

@@ -16,7 +16,7 @@ use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
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)
*/
protected $user;

+ 1
- 1
Model/User/UserPointSaleModel.php Zobrazit soubor

@@ -12,7 +12,7 @@ use Lc\SovBundle\Model\User\UserInterface;
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)
*/
protected $user;

Načítá se…
Zrušit
Uložit