Pārlūkot izejas kodu

Refactoring Model

feature/ticket
Fab pirms 3 gadiem
vecāks
revīzija
eda68d00a6
15 mainītis faili ar 65 papildinājumiem un 25 dzēšanām
  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 Parādīt failu

@@ -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 Parādīt failu

@@ -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 Parādīt failu

@@ -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 Parādīt failu

@@ -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 Parādīt failu

@@ -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 Parādīt failu

@@ -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 Parādīt failu

@@ -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 Parādīt failu

@@ -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 Parādīt failu

@@ -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 Parādīt failu

@@ -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 Parādīt failu

@@ -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 Parādīt failu

@@ -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 Parādīt failu

@@ -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 Parādīt failu

@@ -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 Parādīt failu

@@ -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;

Notiek ielāde…
Atcelt
Saglabāt