Browse Source

Refactoring modèles

feature/ticket
Guillaume 3 years ago
parent
commit
0c488062b0
82 changed files with 399 additions and 408 deletions
  1. +1
    -1
      Model/Address/AddressInterface.php
  2. +5
    -5
      Model/Address/AddressModel.php
  3. +8
    -0
      Model/Common/TaxRateInterface.php
  4. +2
    -2
      Model/Common/TaxRateModel.php
  5. +8
    -0
      Model/Common/UnitInterface.php
  6. +4
    -4
      Model/Common/UnitModel.php
  7. +1
    -1
      Model/Credit/CreditConfigInterface.php
  8. +2
    -2
      Model/Credit/CreditConfigModel.php
  9. +1
    -1
      Model/Credit/CreditHistoryInterface.php
  10. +11
    -11
      Model/Credit/CreditHistoryModel.php
  11. +1
    -1
      Model/File/DocumentInterface.php
  12. +10
    -10
      Model/File/DocumentModel.php
  13. +0
    -8
      Model/Global/TaxRateInterface.php
  14. +0
    -8
      Model/Global/UnitInterface.php
  15. +1
    -1
      Model/Merchant/MerchantConfigInterface.php
  16. +5
    -5
      Model/Merchant/MerchantConfigModel.php
  17. +1
    -1
      Model/Merchant/MerchantInterface.php
  18. +18
    -18
      Model/Merchant/MerchantModel.php
  19. +1
    -1
      Model/Newsletter/NewsletterInterface.php
  20. +5
    -5
      Model/Newsletter/NewsletterModel.php
  21. +0
    -17
      Model/Order/OrderPayment.php
  22. +1
    -1
      Model/Order/OrderPaymentInterface.php
  23. +17
    -0
      Model/Order/OrderPaymentModel.php
  24. +1
    -1
      Model/Order/OrderPayoffInterface.php
  25. +1
    -1
      Model/Order/OrderProductInterface.php
  26. +12
    -12
      Model/Order/OrderProductModel.php
  27. +1
    -1
      Model/Order/OrderProductReductionCatalogInterface.php
  28. +3
    -3
      Model/Order/OrderProductReductionCatalogModel.php
  29. +1
    -1
      Model/Order/OrderProductRefundInterface.php
  30. +5
    -5
      Model/Order/OrderProductRefundModel.php
  31. +1
    -1
      Model/Order/OrderReductionCartInterface.php
  32. +8
    -8
      Model/Order/OrderReductionCartModel.php
  33. +1
    -1
      Model/Order/OrderReductionCreditInterface.php
  34. +7
    -7
      Model/Order/OrderReductionCreditModel.php
  35. +1
    -1
      Model/Order/OrderRefundInterface.php
  36. +6
    -6
      Model/Order/OrderRefundModel.php
  37. +1
    -1
      Model/Order/OrderShopInterface.php
  38. +36
    -36
      Model/Order/OrderShopModel.php
  39. +1
    -1
      Model/Order/OrderShopPriceUtilsInterface.php
  40. +1
    -1
      Model/Order/OrderStatusHistoryInterface.php
  41. +10
    -10
      Model/Order/OrderStatusHistoryModel.php
  42. +1
    -1
      Model/Order/OrderStatusInterface.php
  43. +3
    -3
      Model/Order/OrderStatusModel.php
  44. +1
    -1
      Model/PointSale/PointSaleDayInfoInterface.php
  45. +5
    -5
      Model/PointSale/PointSaleDayInfoModel.php
  46. +1
    -1
      Model/PointSale/PointSaleInterface.php
  47. +11
    -11
      Model/PointSale/PointSaleModel.php
  48. +1
    -1
      Model/Product/ProductCategoryInterface.php
  49. +12
    -12
      Model/Product/ProductCategoryModel.php
  50. +1
    -1
      Model/Product/ProductFamilyInterface.php
  51. +16
    -16
      Model/Product/ProductFamilyModel.php
  52. +1
    -1
      Model/Product/ProductInterface.php
  53. +17
    -17
      Model/Product/ProductModel.php
  54. +2
    -2
      Model/Reduction/ReductionCartInterface.php
  55. +11
    -11
      Model/Reduction/ReductionCartModel.php
  56. +1
    -1
      Model/Reduction/ReductionCatalogInterface.php
  57. +11
    -11
      Model/Reduction/ReductionCatalogModel.php
  58. +1
    -1
      Model/Reduction/ReductionCreditInterface.php
  59. +9
    -9
      Model/Reduction/ReductionCreditModel.php
  60. +1
    -1
      Model/Reminder/ReminderInterface.php
  61. +5
    -5
      Model/Reminder/ReminderModel.php
  62. +1
    -1
      Model/Section/SectionInterface.php
  63. +7
    -7
      Model/Section/SectionModel.php
  64. +1
    -1
      Model/Site/NewsInterface.php
  65. +5
    -5
      Model/Site/NewsModel.php
  66. +1
    -1
      Model/Site/PageInterface.php
  67. +4
    -4
      Model/Site/PageModel.php
  68. +1
    -1
      Model/Ticket/TicketInterface.php
  69. +1
    -1
      Model/Ticket/TicketMessageInterface.php
  70. +6
    -7
      Model/Ticket/TicketMessageModel.php
  71. +12
    -12
      Model/Ticket/TicketModel.php
  72. +1
    -1
      Model/User/GroupUserInterface.php
  73. +8
    -8
      Model/User/GroupUserModel.php
  74. +1
    -1
      Model/User/UserInterface.php
  75. +1
    -1
      Model/User/UserMerchantInterface.php
  76. +9
    -9
      Model/User/UserMerchantModel.php
  77. +18
    -18
      Model/User/UserModel.php
  78. +1
    -1
      Model/User/UserPointSaleInterface.php
  79. +6
    -6
      Model/User/UserPointSaleModel.php
  80. +0
    -8
      Model/User/UserUtilsInterface.php
  81. +1
    -1
      Model/User/VisitorInterface.php
  82. +3
    -3
      Model/User/VisitorModel.php

+ 1
- 1
Model/Address/AddressInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context;
namespace Lc\CaracoleBundle\Model\Address;


interface AddressInterface interface AddressInterface
{ {

Model/Address/Address.php → Model/Address/AddressModel.php View File

namespace Lc\CaracoleBundle\Model\Address; namespace Lc\CaracoleBundle\Model\Address;


use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Context\StatusInterface;
use Lc\SovBundle\Doctrine\Extension\StatusInterface;


/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */
abstract class Address extends AbstractEntity implements StatusInterface
abstract class AddressModel extends AbstractEntity implements StatusInterface
{ {
use StatusTrait; use StatusTrait;


const TYPE_LEGAL_PERSON = 'legal-person'; const TYPE_LEGAL_PERSON = 'legal-person';


/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UserInterface", inversedBy="addresses")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface", inversedBy="addresses")
* @ORM\JoinColumn(nullable=true) * @ORM\JoinColumn(nullable=true)
*/ */
protected $user; protected $user;
protected $comment; protected $comment;


/** /**
* @ORM\OneToOne(targetEntity="Lc\ShopBundle\Context\PointSaleInterface", mappedBy="address", cascade={"persist", "remove"})
* @ORM\OneToOne(targetEntity="Lc\CaracoleBundle\Model\PointSale\PointSaleInterface", mappedBy="address", cascade={"persist", "remove"})
*/ */
protected $pointSale; protected $pointSale;


/** /**
* @ORM\OneToOne(targetEntity="Lc\ShopBundle\Context\MerchantInterface", mappedBy="address", cascade={"persist", "remove"})
* @ORM\OneToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface", mappedBy="address", cascade={"persist", "remove"})
*/ */
protected $merchant; protected $merchant;



+ 8
- 0
Model/Common/TaxRateInterface.php View File

<?php

namespace Lc\CaracoleBundle\Model\Common;

interface TaxRateInterface
{

}

Model/Global/TaxRate.php → Model/Common/TaxRateModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\Common;


use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;


/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */
abstract class TaxRate extends AbstractEntity
abstract class TaxRateModel extends AbstractEntity
{ {


/** /**

+ 8
- 0
Model/Common/UnitInterface.php View File

<?php

namespace Lc\CaracoleBundle\Model\Common ;

interface UnitInterface
{

}

Model/Global/Unit.php → Model/Common/UnitModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\Common;


use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Model\AbstractEntity;
use Lc\CaracoleBundle\Model\AbstractEntity;


/** /**
* @ORM\MappedSuperclass * @ORM\MappedSuperclass
*/ */
abstract class Unit extends AbstractEntity
abstract class UnitModel extends AbstractEntity
{ {
/** /**
* @ORM\Column(type="string", length=32) * @ORM\Column(type="string", length=32)
protected $coefficient; protected $coefficient;


/** /**
* @ORM\ManyToOne(targetEntity="App\Entity\Unit")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Common\UnitInterface")
* @ORM\JoinColumn(nullable=true) * @ORM\JoinColumn(nullable=true)
*/ */
protected $unitReference; protected $unitReference;

+ 1
- 1
Model/Credit/CreditConfigInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context;
namespace Lc\CaracoleBundle\Model\Credit;


interface CreditConfigInterface interface CreditConfigInterface
{ {

Model/Credit/CreditConfig.php → Model/Credit/CreditConfigModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\Credit;


use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;


/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */
abstract class CreditConfig
abstract class CreditConfigModel
{ {
/** /**
* @ORM\Column(type="boolean") * @ORM\Column(type="boolean")

+ 1
- 1
Model/Credit/CreditHistoryInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context;
namespace Lc\CaracoleBundle\Model\Credit;


interface CreditHistoryInterface interface CreditHistoryInterface
{ {

Model/Credit/CreditHistory.php → Model/Credit/CreditHistoryModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\Credit;


use App\Entity\OrderPayment; use App\Entity\OrderPayment;
use App\Entity\OrderRefund; use App\Entity\OrderRefund;
use App\Entity\UserMerchant; use App\Entity\UserMerchant;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Context\OrderPaymentInterface;
use Lc\ShopBundle\Context\OrderRefundInterface;
use Lc\ShopBundle\Context\PayoffInterface;
use Lc\ShopBundle\Context\UserMerchantInterface;
use Lc\CaracoleBundle\Model\Order\OrderPaymentInterface;
use Lc\CaracoleBundle\Model\Order\OrderRefundInterface;
use Lc\CaracoleBundle\Doctrine\Extension\PayoffInterface;
use Lc\CaracoleBundle\Model\User\UserMerchantInterface;
use Gedmo\Mapping\Annotation as Gedmo; use Gedmo\Mapping\Annotation as Gedmo;


/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */
abstract class CreditHistory extends AbstractEntity implements PayoffInterface
abstract class CreditHistoryModel extends AbstractEntity implements PayoffInterface
{ {
use PayoffTrait; use PayoffTrait;


protected $type; protected $type;


/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UserMerchantInterface", inversedBy="creditHistories")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserMerchantInterface", inversedBy="creditHistories")
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $userMerchant; protected $userMerchant;


/** /**
* @ORM\OneToOne(targetEntity="Lc\ShopBundle\Context\OrderPaymentInterface", cascade={"persist", "remove"})
* @ORM\OneToOne(targetEntity="Lc\CaracoleBundle\Model\Order\OrderPaymentInterface", cascade={"persist", "remove"})
*/ */
protected $orderPayment; protected $orderPayment;


/** /**
* @ORM\OneToOne(targetEntity="Lc\ShopBundle\Context\OrderRefundInterface", cascade={"persist", "remove"})
* @ORM\OneToOne(targetEntity="Lc\CaracoleBundle\Model\Order\OrderRefundInterface", cascade={"persist", "remove"})
*/ */
protected $orderRefund; protected $orderRefund;


/** /**
* @Gedmo\Blameable(on="create") * @Gedmo\Blameable(on="create")
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UserInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\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\ShopBundle\Context\UserInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface")
* @ORM\JoinColumn(nullable=true) * @ORM\JoinColumn(nullable=true)
*/ */
protected $updatedBy; protected $updatedBy;

+ 1
- 1
Model/File/DocumentInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context;
namespace Lc\CaracoleBundle\Model\File;


interface DocumentInterface interface DocumentInterface
{ {

Model/File/Document.php → Model/File/DocumentModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\File;


use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Context\FilterMerchantInterface;
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface;
use Gedmo\Mapping\Annotation as Gedmo; use Gedmo\Mapping\Annotation as Gedmo;


/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */
abstract class Document extends AbstractDocumentEntity implements FilterMerchantInterface
abstract class DocumentModel extends AbstractDocumentEntity implements FilterMerchantInterface
{ {
const TYPE_INVOICE = 'invoice'; const TYPE_INVOICE = 'invoice';
const TYPE_QUOTATION = 'quotation'; const TYPE_QUOTATION = 'quotation';
const TYPE_DELIVERY_NOTE = 'delivery-note'; const TYPE_DELIVERY_NOTE = 'delivery-note';


/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\MerchantInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface")
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $merchant; protected $merchant;
protected $logo; protected $logo;


/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\AddressInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Address\AddressInterface")
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $merchantAddress; protected $merchantAddress;


/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\AddressInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Address\AddressInterface")
* @ORM\JoinColumn(nullable=true) * @ORM\JoinColumn(nullable=true)
*/ */
protected $buyerAddress; protected $buyerAddress;
protected $isSent; protected $isSent;


/** /**
* @ORM\ManyToMany(targetEntity="Lc\ShopBundle\Context\OrderShopInterface", mappedBy="documents")
* @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\Order\OrderShopInterface", mappedBy="documents")
* @ORM\JoinColumn(nullable=true) * @ORM\JoinColumn(nullable=true)
*/ */
protected $orderShops; protected $orderShops;




/** /**
* @ORM\OneToOne(targetEntity="Lc\ShopBundle\Context\OrderRefundInterface", mappedBy="document", cascade={"persist", "remove"})
* @ORM\OneToOne(targetEntity="Lc\CaracoleBundle\Model\Order\OrderRefundInterface", mappedBy="document", cascade={"persist", "remove"})
*/ */
protected $orderRefund; protected $orderRefund;


/** /**
* @Gedmo\Blameable(on="create") * @Gedmo\Blameable(on="create")
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UserInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\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\ShopBundle\Context\UserInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface")
* @ORM\JoinColumn(nullable=true) * @ORM\JoinColumn(nullable=true)
*/ */
protected $updatedBy; protected $updatedBy;

+ 0
- 8
Model/Global/TaxRateInterface.php View File

<?php

namespace Lc\ShopBundle\Context;

interface TaxRateInterface
{

}

+ 0
- 8
Model/Global/UnitInterface.php View File

<?php

namespace Lc\ShopBundle\Context ;

interface UnitInterface
{

}

+ 1
- 1
Model/Merchant/MerchantConfigInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context;
namespace Lc\CaracoleBundle\Model\Merchant;


interface MerchantConfigInterface interface MerchantConfigInterface
{ {

Model/Merchant/MerchantConfig.php → Model/Merchant/MerchantConfigModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\Merchant;


use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File; use Symfony\Component\HttpFoundation\File\File;
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
* @Vich\Uploadable * @Vich\Uploadable
*/ */
abstract class MerchantConfig extends AbstractEntity
abstract class MerchantConfigModel extends AbstractEntity
{ {
/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\MerchantInterface", inversedBy="merchantConfigs")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface", inversedBy="merchantConfigs")
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $merchant; protected $merchant;


public static $availableOptions = []; public static $availableOptions = [];


public function getMerchant(): ?Merchant
public function getMerchant(): ?MerchantModel
{ {
return $this->merchant; return $this->merchant;
} }


public function setMerchant(?Merchant $merchant): self
public function setMerchant(?MerchantModel $merchant): self
{ {
$this->merchant = $merchant; $this->merchant = $merchant;



+ 1
- 1
Model/Merchant/MerchantInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context;
namespace Lc\CaracoleBundle\Model\Merchant;


interface MerchantInterface interface MerchantInterface
{ {

Model/Merchant/Merchant.php → Model/Merchant/MerchantModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\Merchant;


use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Context\CreditConfigInterface;
use Lc\ShopBundle\Context\GroupUserInterface;
use Lc\CaracoleBundle\Model\Credit\CreditConfigInterface;
use Lc\CaracoleBundle\Model\User\GroupUserInterface;


/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */
abstract class Merchant extends AbstractDocumentEntity
abstract class MerchantModel extends AbstractDocumentEntity
{ {
/** /**
* @ORM\OneToOne(targetEntity="Lc\ShopBundle\Context\CreditConfigInterface", cascade={"persist", "remove"})
* @ORM\OneToOne(targetEntity="Lc\CaracoleBundle\Model\Credit\CreditConfigInterface", cascade={"persist", "remove"})
* @ORM\JoinColumn(nullable=true) * @ORM\JoinColumn(nullable=true)
*/ */
protected $creditConfig; protected $creditConfig;


/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\TaxRateInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Common\TaxRateInterface")
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $taxRate; protected $taxRate;


/** /**
* @ORM\ManyToMany(targetEntity="Lc\ShopBundle\Context\PointSaleInterface", mappedBy="merchants")
* @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\PointSale\PointSaleInterface", mappedBy="merchants")
*/ */
protected $pointSales; protected $pointSales;


/** /**
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\ProductFamilyInterface", mappedBy="merchant")
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Product\ProductFamilyInterface", mappedBy="merchant")
*/ */
protected $productFamilies; protected $productFamilies;


/** /**
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\MerchantConfigInterface", mappedBy="merchant", orphanRemoval=true, cascade={"persist"})
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantConfigInterface", mappedBy="merchant", orphanRemoval=true, cascade={"persist"})
*/ */
protected $merchantConfigs; protected $merchantConfigs;


/** /**
* @ORM\OneToOne(targetEntity="Lc\ShopBundle\Context\AddressInterface", inversedBy="merchant", cascade={"persist", "remove"})
* @ORM\OneToOne(targetEntity="Lc\CaracoleBundle\Model\Address\AddressInterface", inversedBy="merchant", cascade={"persist", "remove"})
* @ORM\JoinColumn(nullable=true) * @ORM\JoinColumn(nullable=true)
*/ */
protected $address; protected $address;


/** /**
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\ProductCategoryInterface", mappedBy="merchant", orphanRemoval=true)
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Product\ProductCategoryInterface", mappedBy="merchant", orphanRemoval=true)
*/ */
protected $productCategories; protected $productCategories;


/** /**
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\NewsInterface", mappedBy="merchant", orphanRemoval=true)
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\News\NewsInterface", mappedBy="merchant", orphanRemoval=true)
*/ */
protected $news; protected $news;


/** /**
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\PageInterface", mappedBy="merchant", orphanRemoval=true)
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Site\PageInterface", mappedBy="merchant", orphanRemoval=true)
*/ */
protected $pages; protected $pages;


/** /**
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\NewsletterInterface", mappedBy="merchant")
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Newsletter\NewsletterInterface", mappedBy="merchant")
*/ */
protected $newsletters; protected $newsletters;


/** /**
* @ORM\OneToMany(targetEntity="App\Entity\GroupUser", mappedBy="merchant")
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\User\GroupUser", mappedBy="merchant")
*/ */
protected $groupUsers; protected $groupUsers;


} }


/** /**
* @return Collection|MerchantConfig[]
* @return Collection|MerchantConfigModel[]
*/ */
public function getMerchantConfigs(): Collection public function getMerchantConfigs(): Collection
{ {
return $this->merchantConfigs; return $this->merchantConfigs;
} }


public function addMerchantConfig(MerchantConfig $merchantConfig): self
public function addMerchantConfig(MerchantConfigModel $merchantConfig): self
{ {
if (!$this->merchantConfigs->contains($merchantConfig)) { if (!$this->merchantConfigs->contains($merchantConfig)) {
$this->merchantConfigs[] = $merchantConfig; $this->merchantConfigs[] = $merchantConfig;
return $this; return $this;
} }


public function removeMerchantConfig(MerchantConfig $merchantConfig): self
public function removeMerchantConfig(MerchantConfigModel $merchantConfig): self
{ {
if ($this->merchantConfigs->contains($merchantConfig)) { if ($this->merchantConfigs->contains($merchantConfig)) {
$this->merchantConfigs->removeElement($merchantConfig); $this->merchantConfigs->removeElement($merchantConfig);

+ 1
- 1
Model/Newsletter/NewsletterInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context ;
namespace Lc\CaracoleBundle\Model\Newsletter ;


interface NewsletterInterface interface NewsletterInterface
{ {

Model/Newsletter/Newsletter.php → Model/Newsletter/NewsletterModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\Newsletter;


use App\Entity\Hub; use App\Entity\Hub;
use App\Entity\User; use App\Entity\User;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Context\FilterMerchantInterface;
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface;


/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */
abstract class Newsletter extends AbstractDocumentEntity implements FilterMerchantInterface
abstract class NewsletterModel extends AbstractDocumentEntity implements FilterMerchantInterface
{ {
/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\MerchantInterface", inversedBy="newsletters")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface", inversedBy="newsletters")
*/ */
protected $merchant; protected $merchant;


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



+ 0
- 17
Model/Order/OrderPayment.php View File

<?php

namespace Lc\ShopBundle\Model;

use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Context\OrderPaymentInterface;
use Lc\ShopBundle\Context\OrderPayoffInterface;
use Lc\ShopBundle\Context\ReductionInterface;

/**
* @ORM\MappedSuperclass()
*/
abstract class OrderPayment extends AbstractEntity implements OrderPayoffInterface
{
use OrderPayoffTrait;

}

+ 1
- 1
Model/Order/OrderPaymentInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context ;
namespace Lc\CaracoleBundle\Model\Order ;


interface OrderPaymentInterface interface OrderPaymentInterface
{ {

+ 17
- 0
Model/Order/OrderPaymentModel.php View File

<?php

namespace Lc\CaracoleBundle\Model\Order;

use Doctrine\ORM\Mapping as ORM;
use Lc\CaracoleBundle\Model\Order\OrderPaymentInterface;
use Lc\CaracoleBundle\Model\Order\OrderPayoffInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionInterface;

/**
* @ORM\MappedSuperclass()
*/
abstract class OrderPaymentModel extends AbstractEntity implements OrderPayoffInterface
{
use OrderPayoffTrait;

}

+ 1
- 1
Model/Order/OrderPayoffInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context;
namespace Lc\CaracoleBundle\Model\Order;


interface OrderPayoffInterface interface OrderPayoffInterface
{ {

+ 1
- 1
Model/Order/OrderProductInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context;
namespace Lc\CaracoleBundle\Model\Order;


interface OrderProductInterface interface OrderProductInterface
{ {

Model/Order/OrderProduct.php → Model/Order/OrderProductModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\Order;


use App\Entity\OrderProductReductionCatalog;
use Lc\CaracoleBundle\Model\Order\OrderProductReductionCatalog;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Context\PriceInterface;
use Lc\CaracoleBundle\Doctrine\Extension\PriceInterface;


/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */
abstract class OrderProduct implements PriceInterface
abstract class OrderProductModel implements PriceInterface
{ {
use PriceTrait ; use PriceTrait ;


/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\OrderShopInterface", inversedBy="orderProducts", cascade={"persist"})
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Order\OrderShopInterface", inversedBy="orderProducts", cascade={"persist"})
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $orderShop; protected $orderShop;


/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\ProductInterface"))
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Product\ProductInterface"))
*/ */
protected $product; protected $product;


protected $title; protected $title;


/** /**
* @ORM\OneToOne(targetEntity="Lc\ShopBundle\Context\OrderProductReductionCatalogInterface", cascade={"persist", "remove"})
* @ORM\OneToOne(targetEntity="Lc\CaracoleBundle\Model\Order\OrderProductReductionCatalogInterface", cascade={"persist", "remove"})
*/ */
protected $orderProductReductionCatalog; protected $orderProductReductionCatalog;


/** /**
* @ORM\OneToOne(targetEntity="Lc\ShopBundle\Context\OrderProductRefundInterface", mappedBy="orderProduct", cascade={"persist", "remove"})
* @ORM\OneToOne(targetEntity="Lc\CaracoleBundle\Model\Order\OrderProductRefundInterface", mappedBy="orderProduct", cascade={"persist", "remove"})
*/ */
protected $orderProductRefund; protected $orderProductRefund;


return $title ; return $title ;
} }


public function getOrderShop(): ?OrderShop
public function getOrderShop(): ?OrderShopModel
{ {
return $this->orderShop; return $this->orderShop;
} }


public function setOrderShop(?OrderShop $orderShop): self
public function setOrderShop(?OrderShopModel $orderShop): self
{ {
$this->orderShop = $orderShop; $this->orderShop = $orderShop;




return $this; return $this;
} }
public function getOrderProductRefund(): ?OrderProductRefund
public function getOrderProductRefund(): ?OrderProductRefundModel
{ {
return $this->orderProductRefund; return $this->orderProductRefund;
} }


public function setOrderProductRefund(OrderProductRefund $orderProductRefund): self
public function setOrderProductRefund(OrderProductRefundModel $orderProductRefund): self
{ {
$this->orderProductRefund = $orderProductRefund; $this->orderProductRefund = $orderProductRefund;



+ 1
- 1
Model/Order/OrderProductReductionCatalogInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context ;
namespace Lc\CaracoleBundle\Model\Order ;


interface OrderProductReductionCatalogInterface interface OrderProductReductionCatalogInterface
{ {

Model/Order/OrderProductReductionCatalog.php → Model/Order/OrderProductReductionCatalogModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\Order;


use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Context\OrderProductReductionCatalogInterface;
use Lc\CaracoleBundle\Model\Order\OrderProductReductionCatalogInterface;


/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */
abstract class OrderProductReductionCatalog implements OrderProductReductionCatalogInterface
abstract class OrderProductReductionCatalogModel implements OrderProductReductionCatalogInterface
{ {
use ReductionTrait ; use ReductionTrait ;



+ 1
- 1
Model/Order/OrderProductRefundInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context;
namespace Lc\CaracoleBundle\Model\Order;


interface OrderProductRefundInterface interface OrderProductRefundInterface
{ {

Model/Order/OrderProductRefund.php → Model/Order/OrderProductRefundModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\Order;


use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;


/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */
abstract class OrderProductRefund
abstract class OrderProductRefundModel
{ {
/** /**
* @ORM\Column(type="integer") * @ORM\Column(type="integer")
protected $price; protected $price;


/** /**
* @ORM\OneToOne(targetEntity="Lc\ShopBundle\Context\OrderProductInterface", inversedBy="orderProductRefund", cascade={"persist", "remove"})
* @ORM\OneToOne(targetEntity="Lc\CaracoleBundle\Model\Order\OrderProductInterface", inversedBy="orderProductRefund", cascade={"persist", "remove"})
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $orderProduct; protected $orderProduct;
return $this; return $this;
} }


public function getOrderProduct(): ?OrderProduct
public function getOrderProduct(): ?OrderProductModel
{ {
return $this->orderProduct; return $this->orderProduct;
} }


public function setOrderProduct(OrderProduct $orderProduct): self
public function setOrderProduct(OrderProductModel $orderProduct): self
{ {
$this->orderProduct = $orderProduct; $this->orderProduct = $orderProduct;



+ 1
- 1
Model/Order/OrderReductionCartInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context;
namespace Lc\CaracoleBundle\Model\Order;


interface OrderReductionCartInterface interface OrderReductionCartInterface
{ {

Model/Order/OrderReductionCart.php → Model/Order/OrderReductionCartModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\Order;


use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Context\ReductionCartPropertyInterface;
use Lc\ShopBundle\Context\ReductionInterface;
use Lc\CaracoleBundle\Doctrine\Extension\ReductionCartPropertyInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionInterface;


/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */
abstract class OrderReductionCart implements ReductionInterface, ReductionCartPropertyInterface
abstract class OrderReductionCartModel implements ReductionInterface, ReductionCartPropertyInterface
{ {
use ReductionTrait; use ReductionTrait;
use ReductionCartPropertyTrait; use ReductionCartPropertyTrait;
protected $title; protected $title;


/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\OrderShopInterface", inversedBy="orderReductionCarts")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Order\OrderShopInterface", inversedBy="orderReductionCarts")
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $orderShop; protected $orderShop;




/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\ReductionCartInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Reduction\ReductionCartInterface")
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $reductionCart; protected $reductionCart;
return $this; return $this;
} }


public function getOrderShop(): ?OrderShop
public function getOrderShop(): ?OrderShopModel
{ {
return $this->orderShop; return $this->orderShop;
} }


public function setOrderShop(?OrderShop $orderShop): self
public function setOrderShop(?OrderShopModel $orderShop): self
{ {
$this->orderShop = $orderShop; $this->orderShop = $orderShop;



+ 1
- 1
Model/Order/OrderReductionCreditInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context;
namespace Lc\CaracoleBundle\Model\Order;


interface OrderReductionCreditInterface interface OrderReductionCreditInterface
{ {

Model/Order/OrderReductionCredit.php → Model/Order/OrderReductionCreditModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\Order;


use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Context\ReductionInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionInterface;


/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */
abstract class OrderReductionCredit implements ReductionInterface
abstract class OrderReductionCreditModel implements ReductionInterface
{ {
use ReductionTrait ; use ReductionTrait ;






/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\OrderShopInterface", inversedBy="orderReductionCredits")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Order\OrderShopInterface", inversedBy="orderReductionCredits")
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $orderShop; protected $orderShop;


/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\ReductionCreditInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Reduction\ReductionCreditInterface")
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $reductionCredit; protected $reductionCredit;
return $this; return $this;
} }


public function getOrderShop(): ?OrderShop
public function getOrderShop(): ?OrderShopModel
{ {
return $this->orderShop; return $this->orderShop;
} }


public function setOrderShop(?OrderShop $orderShop): self
public function setOrderShop(?OrderShopModel $orderShop): self
{ {
$this->orderShop = $orderShop; $this->orderShop = $orderShop;



+ 1
- 1
Model/Order/OrderRefundInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context;
namespace Lc\CaracoleBundle\Model\Order;


interface OrderRefundInterface interface OrderRefundInterface
{ {

Model/Order/OrderRefund.php → Model/Order/OrderRefundModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\Order;


use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Context\OrderPaymentInterface;
use Lc\ShopBundle\Context\OrderPayoffInterface;
use Lc\ShopBundle\Context\ReductionInterface;
use Lc\CaracoleBundle\Model\Order\OrderPaymentInterface;
use Lc\CaracoleBundle\Doctrine\Extension\OrderPayoffInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionInterface;


/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */
abstract class OrderRefund extends AbstractEntity implements OrderPayoffInterface
abstract class OrderRefundModel extends AbstractEntity implements OrderPayoffInterface
{ {
use OrderPayoffTrait; use OrderPayoffTrait;


protected $deliveryRefundAmount; protected $deliveryRefundAmount;


/** /**
* @ORM\OneToOne(targetEntity="Lc\ShopBundle\Context\DocumentInterface", inversedBy="orderRefund", cascade={"persist", "remove"})
* @ORM\OneToOne(targetEntity="Lc\CaracoleBundle\Model\File\DocumentInterface", inversedBy="orderRefund", cascade={"persist", "remove"})
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $document; protected $document;

+ 1
- 1
Model/Order/OrderShopInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context;
namespace Lc\CaracoleBundle\Model\Order;


interface OrderShopInterface interface OrderShopInterface
{ {

Model/Order/OrderShop.php → Model/Order/OrderShopModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\Order;


use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Gedmo\Mapping\Annotation as Gedmo; use Gedmo\Mapping\Annotation as Gedmo;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Context\DocumentInterface;
use Lc\ShopBundle\Context\FilterMerchantInterface;
use Lc\ShopBundle\Services\Order\OrderUtils;
use Lc\ShopBundle\Model\OrderStatus ;
use Lc\CaracoleBundle\Model\File\DocumentInterface;
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface;
use Lc\CaracoleBundle\Services\Order\OrderUtils;
use Lc\CaracoleBundle\Model\OrderStatus ;


/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */
abstract class OrderShop extends AbstractEntity implements FilterMerchantInterface
abstract class OrderShopModel extends AbstractEntity implements FilterMerchantInterface
{ {
/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\MerchantInterface", inversedBy="productFamilies")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface", inversedBy="productFamilies")
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $merchant; protected $merchant;


/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UserInterface", inversedBy="orders", fetch="EAGER")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface", inversedBy="orders", fetch="EAGER")
*/ */
protected $user; protected $user;


/** /**
* @ORM\ManyToOne(targetEntity="App\Entity\Visitor", inversedBy="orders")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\VisitorInterface", inversedBy="orders")
*/ */
protected $visitor; protected $visitor;


/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\AddressInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Address\AddressInterface")
*/ */
protected $invoiceAddress; protected $invoiceAddress;


protected $meanPayment; protected $meanPayment;


/** /**
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\OrderStatusHistoryInterface", mappedBy="orderShop", orphanRemoval=true)
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Order\OrderStatusHistoryInterface", mappedBy="orderShop", orphanRemoval=true)
*/ */
protected $orderStatusHistories; protected $orderStatusHistories;


/** /**
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\OrderPaymentInterface", mappedBy="orderShop", orphanRemoval=true)
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Order\OrderPaymentInterface", mappedBy="orderShop", orphanRemoval=true)
*/ */
protected $orderPayments; protected $orderPayments;


/** /**
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\OrderProductInterface", mappedBy="orderShop", cascade={"persist", "remove"}, orphanRemoval=true, fetch="EAGER")
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Order\OrderProductInterface", mappedBy="orderShop", cascade={"persist", "remove"}, orphanRemoval=true, fetch="EAGER")
*/ */
protected $orderProducts; protected $orderProducts;


protected $deliveryInfos; protected $deliveryInfos;


/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\OrderStatusInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Order\OrderStatusInterface")
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $orderStatus; protected $orderStatus;


/** /**
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\OrderReductionCartInterface", mappedBy="orderShop", orphanRemoval=true)
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Order\OrderReductionCartInterface", mappedBy="orderShop", orphanRemoval=true)
*/ */
protected $orderReductionCarts; protected $orderReductionCarts;


/** /**
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\OrderReductionCreditInterface", mappedBy="orderShop", orphanRemoval=true)
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Order\OrderReductionCreditInterface", mappedBy="orderShop", orphanRemoval=true)
*/ */
protected $orderReductionCredits; protected $orderReductionCredits;


/** /**
* @ORM\ManyToMany(targetEntity="Lc\ShopBundle\Context\DocumentInterface", inversedBy="orderShops")
* @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\Order\DocumentInterface", inversedBy="orderShops")
*/ */
protected $documents; protected $documents;


/** /**
* @Gedmo\Blameable(on="create") * @Gedmo\Blameable(on="create")
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UserInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\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\ShopBundle\Context\UserInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface")
* @ORM\JoinColumn(nullable=true) * @ORM\JoinColumn(nullable=true)
*/ */
protected $updatedBy; protected $updatedBy;


/** /**
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\TicketInterface", mappedBy="orderShop")
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Ticket\TicketInterface", mappedBy="orderShop")
*/ */
protected $tickets; protected $tickets;


/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\SectionInterface", inversedBy="orderShops")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Section\SectionInterface", inversedBy="orderShops")
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $section; protected $section;
} }


/** /**
* @return Collection|OrderStatusHistory[]
* @return Collection|OrderStatusHistoryModel[]
*/ */
public function getOrderStatusHistories(): Collection public function getOrderStatusHistories(): Collection
{ {
return $this->orderStatusHistories; return $this->orderStatusHistories;
} }


public function addOrderStatusHistory(OrderStatusHistory $orderStatusHistory): self
public function addOrderStatusHistory(OrderStatusHistoryModel $orderStatusHistory): self
{ {
if (!$this->orderStatusHistories->contains($orderStatusHistory)) { if (!$this->orderStatusHistories->contains($orderStatusHistory)) {
$this->orderStatusHistories[] = $orderStatusHistory; $this->orderStatusHistories[] = $orderStatusHistory;
return $this; return $this;
} }


public function removeOrderStatusHistory(OrderStatusHistory $orderStatusHistory): self
public function removeOrderStatusHistory(OrderStatusHistoryModel $orderStatusHistory): self
{ {
if ($this->orderStatusHistories->contains($orderStatusHistory)) { if ($this->orderStatusHistories->contains($orderStatusHistory)) {
$this->orderStatusHistories->removeElement($orderStatusHistory); $this->orderStatusHistories->removeElement($orderStatusHistory);
} }


/** /**
* @return Collection|OrderPayment[]
* @return Collection|OrderPaymentModel[]
*/ */
public function getOrderPayments($meanPayment = null): Collection public function getOrderPayments($meanPayment = null): Collection
{ {
return $this->orderPayments; return $this->orderPayments;
} }


public function addOrderPayment(OrderPayment $orderPayment): self
public function addOrderPayment(OrderPaymentModel $orderPayment): self
{ {
if (!$this->orderPayments->contains($orderPayment)) { if (!$this->orderPayments->contains($orderPayment)) {
$this->orderPayments[] = $orderPayment; $this->orderPayments[] = $orderPayment;
return $this; return $this;
} }


public function removeOrderPayment(OrderPayment $orderPayment): self
public function removeOrderPayment(OrderPaymentModel $orderPayment): self
{ {
if ($this->orderPayments->contains($orderPayment)) { if ($this->orderPayments->contains($orderPayment)) {
$this->orderPayments->removeElement($orderPayment); $this->orderPayments->removeElement($orderPayment);
} }


/** /**
* @return Collection|OrderProduct[]
* @return Collection|OrderProductModel[]
*/ */
public function getOrderProducts(): Collection public function getOrderProducts(): Collection
{ {
return $this->orderProducts; return $this->orderProducts;
} }


public function addOrderProduct(OrderProduct $orderProduct): self
public function addOrderProduct(OrderProductModel $orderProduct): self
{ {
if (!$this->orderProducts->contains($orderProduct)) { if (!$this->orderProducts->contains($orderProduct)) {
$this->orderProducts[] = $orderProduct; $this->orderProducts[] = $orderProduct;
return $this; return $this;
} }


public function removeOrderProduct(OrderProduct $orderProduct): self
public function removeOrderProduct(OrderProductModel $orderProduct): self
{ {
if ($this->orderProducts->contains($orderProduct)) { if ($this->orderProducts->contains($orderProduct)) {
$this->orderProducts->removeElement($orderProduct); $this->orderProducts->removeElement($orderProduct);




/** /**
* @return Collection|OrderReductionCart[]
* @return Collection|OrderReductionCartModel[]
*/ */
public function getOrderReductionCarts(): Collection public function getOrderReductionCarts(): Collection
{ {
return $this->orderReductionCarts; return $this->orderReductionCarts;
} }


public function addOrderReductionCart(OrderReductionCart $orderReductionCart): self
public function addOrderReductionCart(OrderReductionCartModel $orderReductionCart): self
{ {
if (!$this->orderReductionCarts->contains($orderReductionCart)) { if (!$this->orderReductionCarts->contains($orderReductionCart)) {
$this->orderReductionCarts[] = $orderReductionCart; $this->orderReductionCarts[] = $orderReductionCart;
return $this; return $this;
} }


public function removeOrderReductionCart(OrderReductionCart $orderReductionCart): self
public function removeOrderReductionCart(OrderReductionCartModel $orderReductionCart): self
{ {
if ($this->orderReductionCarts->contains($orderReductionCart)) { if ($this->orderReductionCarts->contains($orderReductionCart)) {
$this->orderReductionCarts->removeElement($orderReductionCart); $this->orderReductionCarts->removeElement($orderReductionCart);
} }


/** /**
* @return Collection|OrderReductionCart[]
* @return Collection|OrderReductionCartModel[]
*/ */
public function getOrderReductionCredits(): Collection public function getOrderReductionCredits(): Collection
{ {
return $this->orderReductionCredits; return $this->orderReductionCredits;
} }


public function addOrderReductionCredit(OrderReductionCredit $orderReductionCredit): self
public function addOrderReductionCredit(OrderReductionCreditModel $orderReductionCredit): self
{ {
if (!$this->orderReductionCredits->contains($orderReductionCredit)) { if (!$this->orderReductionCredits->contains($orderReductionCredit)) {
$this->orderReductionCredits[] = $orderReductionCredit; $this->orderReductionCredits[] = $orderReductionCredit;
return $this; return $this;
} }


public function removeOrderReductionCredit(OrderReductionCredit $orderReductionCredit): self
public function removeOrderReductionCredit(OrderReductionCreditModel $orderReductionCredit): self
{ {
if ($this->orderReductionCredits->contains($orderReductionCredit)) { if ($this->orderReductionCredits->contains($orderReductionCredit)) {
$this->orderReductionCredits->removeElement($orderReductionCredit); $this->orderReductionCredits->removeElement($orderReductionCredit);

+ 1
- 1
Model/Order/OrderShopPriceUtilsInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context ;
namespace Lc\CaracoleBundle\Model\Order ;


interface OrderShopPriceUtilsInterface interface OrderShopPriceUtilsInterface
{ {

+ 1
- 1
Model/Order/OrderStatusHistoryInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context;
namespace Lc\CaracoleBundle\Model\Order;


interface OrderStatusHistoryInterface interface OrderStatusHistoryInterface
{ {

Model/Order/OrderStatusHistory.php → Model/Order/OrderStatusHistoryModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\Order;


use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo; use Gedmo\Mapping\Annotation as Gedmo;
/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */
abstract class OrderStatusHistory extends AbstractEntity
abstract class OrderStatusHistoryModel extends AbstractEntity
{ {
/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\OrderShopInterface", inversedBy="orderStatusHistories")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Order\OrderShopInterface", inversedBy="orderStatusHistories")
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $orderShop; protected $orderShop;


/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\OrderStatusInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Order\OrderStatusInterface")
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $orderStatus; protected $orderStatus;


/** /**
* @Gedmo\Blameable(on="create") * @Gedmo\Blameable(on="create")
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UserInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\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\ShopBundle\Context\UserInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface")
* @ORM\JoinColumn(nullable=true) * @ORM\JoinColumn(nullable=true)
*/ */
protected $updatedBy; protected $updatedBy;
return $this->getOrderStatus()->getAlias(). ' le : '.$this->getCreatedAt()->format('d-m-Y H:i').'('.$this->getOrigin().')'; return $this->getOrderStatus()->getAlias(). ' le : '.$this->getCreatedAt()->format('d-m-Y H:i').'('.$this->getOrigin().')';
} }


public function getOrderShop(): ?OrderShop
public function getOrderShop(): ?OrderShopModel
{ {
return $this->orderShop; return $this->orderShop;
} }


public function setOrderShop(?OrderShop $orderShop): self
public function setOrderShop(?OrderShopModel $orderShop): self
{ {
$this->orderShop = $orderShop; $this->orderShop = $orderShop;


return $this; return $this;
} }


public function getOrderStatus(): ?OrderStatus
public function getOrderStatus(): ?OrderStatusModel
{ {
return $this->orderStatus; return $this->orderStatus;
} }


public function setOrderStatus(?OrderStatus $orderStatus): self
public function setOrderStatus(?OrderStatusModel $orderStatus): self
{ {
$this->orderStatus = $orderStatus; $this->orderStatus = $orderStatus;



+ 1
- 1
Model/Order/OrderStatusInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context;
namespace Lc\CaracoleBundle\Model\Order;


interface OrderStatusInterface interface OrderStatusInterface
{ {

Model/Order/OrderStatus.php → Model/Order/OrderStatusModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\Order;


use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */
abstract class OrderStatus
abstract class OrderStatusModel
{ {
const ALIAS_CART = 'cart' ; const ALIAS_CART = 'cart' ;
const ALIAS_CART_CANCELED = 'cart-canceled' ; const ALIAS_CART_CANCELED = 'cart-canceled' ;
protected $description; protected $description;


/** /**
* @ORM\ManyToMany(targetEntity="Lc\ShopBundle\Context\OrderStatusInterface")
* @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\Order\OrderStatusInterface")
*/ */
protected $nextStatusAllowed; protected $nextStatusAllowed;



+ 1
- 1
Model/PointSale/PointSaleDayInfoInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context;
namespace Lc\CaracoleBundle\Model\PointSale;


interface PointSaleDayInfoInterface interface PointSaleDayInfoInterface
{ {

Model/PointSale/PointSaleDayInfo.php → Model/PointSale/PointSaleDayInfoModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\PointSale;


use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;


/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */
abstract class PointSaleDayInfo extends AbstractEntity
abstract class PointSaleDayInfoModel extends AbstractEntity
{ {
/** /**
* @ORM\Column(type="boolean") * @ORM\Column(type="boolean")
protected $description; protected $description;


/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\PointSaleInterface", inversedBy="pointSaleDayInfos")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\PointSale\PointSaleInterface", inversedBy="pointSaleDayInfos")
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $pointSale; protected $pointSale;
return $this; return $this;
} }


public function getPointSale(): ?PointSale
public function getPointSale(): ?PointSaleModel
{ {
return $this->pointSale; return $this->pointSale;
} }


public function setPointSale(?PointSale $pointSale): self
public function setPointSale(?PointSaleModel $pointSale): self
{ {
$this->pointSale = $pointSale; $this->pointSale = $pointSale;



+ 1
- 1
Model/PointSale/PointSaleInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context;
namespace Lc\CaracoleBundle\Model\PointSale;


interface PointSaleInterface interface PointSaleInterface
{ {

Model/PointSale/PointSale.php → Model/PointSale/PointSaleModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\PointSale;


use App\Entity\User; use App\Entity\User;
use App\Entity\UserPointSale; use App\Entity\UserPointSale;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Context\FilterMultipleMerchantsInterface;
use Lc\ShopBundle\Context\OrderAmountMinInterface;
use Lc\CaracoleBundle\Doctrine\Extension\FilterMultipleMerchantsInterface;
use Lc\CaracoleBundle\Doctrine\Extension\OrderAmountMinInterface;


/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */
abstract class PointSale extends AbstractDocumentEntity implements FilterMultipleMerchantsInterface, OrderAmountMinInterface
abstract class PointSaleModel extends AbstractDocumentEntity implements FilterMultipleMerchantsInterface, OrderAmountMinInterface
{ {


use OrderAmountMin; use OrderAmountMin;
/** /**
* @ORM\ManyToMany(targetEntity="Lc\ShopBundle\Context\MerchantInterface", inversedBy="pointSales")
* @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface", inversedBy="pointSales")
*/ */
protected $merchants; protected $merchants;


protected $code; protected $code;


/** /**
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\PointSaleDayInfoInterface", mappedBy="pointSale", orphanRemoval=true)
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Pointsale\PointSaleDayInfoInterface", mappedBy="pointSale", orphanRemoval=true)
*/ */
protected $pointSaleDayInfos; protected $pointSaleDayInfos;


/** /**
* @ORM\OneToOne(targetEntity="Lc\ShopBundle\Context\AddressInterface", inversedBy="pointSale", cascade={"persist", "remove"})
* @ORM\OneToOne(targetEntity="Lc\CaracoleBundle\Model\Address\AddressInterface", inversedBy="pointSale", cascade={"persist", "remove"})
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $address; protected $address;


/** /**
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\UserPointSaleInterface", mappedBy="pointSale", orphanRemoval=true)
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\User\UserPointSaleInterface", mappedBy="pointSale", orphanRemoval=true)
*/ */
protected $userPointSales; protected $userPointSales;


} }


/** /**
* @return Collection|PointSaleDayInfo[]
* @return Collection|PointSaleDayInfoModel[]
*/ */
public function getPointSaleDayInfos(): Collection public function getPointSaleDayInfos(): Collection
{ {
return $this->pointSaleDayInfos; return $this->pointSaleDayInfos;
} }


public function addPointSaleDayInfo(PointSaleDayInfo $pointSaleDayInfo): self
public function addPointSaleDayInfo(PointSaleDayInfoModel $pointSaleDayInfo): self
{ {
if (!$this->pointSaleDayInfos->contains($pointSaleDayInfo)) { if (!$this->pointSaleDayInfos->contains($pointSaleDayInfo)) {
$this->pointSaleDayInfos[] = $pointSaleDayInfo; $this->pointSaleDayInfos[] = $pointSaleDayInfo;
return $this; return $this;
} }


public function removePointSaleDayInfo(PointSaleDayInfo $pointSaleDayInfo): self
public function removePointSaleDayInfo(PointSaleDayInfoModel $pointSaleDayInfo): self
{ {
if ($this->pointSaleDayInfos->contains($pointSaleDayInfo)) { if ($this->pointSaleDayInfos->contains($pointSaleDayInfo)) {
$this->pointSaleDayInfos->removeElement($pointSaleDayInfo); $this->pointSaleDayInfos->removeElement($pointSaleDayInfo);

+ 1
- 1
Model/Product/ProductCategoryInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context;
namespace Lc\CaracoleBundle\Model\Product;


interface ProductCategoryInterface interface ProductCategoryInterface
{ {

Model/Product/ProductCategory.php → Model/Product/ProductCategoryModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\Product;


use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Context\FilterMerchantInterface;
use Lc\ShopBundle\Context\TreeInterface;
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface;
use Lc\SovBundle\Doctrine\Extension\TreeInterface;


/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */
abstract class ProductCategory extends AbstractDocumentEntity implements TreeInterface, FilterMerchantInterface
abstract class ProductCategoryModel extends AbstractDocumentEntity implements TreeInterface, FilterMerchantInterface
{ {


/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\MerchantInterface", inversedBy="productCategories")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface", inversedBy="productCategories")
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $merchant; protected $merchant;


/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\ProductCategoryInterface", inversedBy="childrens")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Product\ProductCategoryInterface", inversedBy="childrens")
*/ */
protected $parent; protected $parent;


/** /**
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\ProductCategoryInterface", mappedBy="parent" , fetch="EAGER"))
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Product\ProductCategoryInterface", mappedBy="parent" , fetch="EAGER"))
* @ORM\OrderBy({"position" = "ASC"}) * @ORM\OrderBy({"position" = "ASC"})
*/ */
protected $childrens; protected $childrens;


/** /**
* @ORM\ManyToMany(targetEntity="Lc\ShopBundle\Context\ProductFamilyInterface", mappedBy="productCategories")
* @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\Product\ProductFamilyInterface", mappedBy="productCategories")
*/ */
protected $productFamilies; protected $productFamilies;






/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\SectionInterface", inversedBy="productCategories")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Section\SectionInterface", inversedBy="productCategories")
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $section; protected $section;
} }


/** /**
* @return Collection|ProductFamily[]
* @return Collection|ProductFamilyModel[]
*/ */
public function getProductFamilies(): Collection public function getProductFamilies(): Collection
{ {
return $this->productFamilies; return $this->productFamilies;
} }


public function addProductFamily(ProductFamily $productFamily): self
public function addProductFamily(ProductFamilyModel $productFamily): self
{ {
if (!$this->productFamilies->contains($productFamily)) { if (!$this->productFamilies->contains($productFamily)) {
$this->productFamilies[] = $productFamily; $this->productFamilies[] = $productFamily;
return $this; return $this;
} }


public function removeProductFamily(ProductFamily $productFamily): self
public function removeProductFamily(ProductFamilyModel $productFamily): self
{ {
if ($this->productFamilies->contains($productFamily)) { if ($this->productFamilies->contains($productFamily)) {
$this->productFamilies->removeElement($productFamily); $this->productFamilies->removeElement($productFamily);

+ 1
- 1
Model/Product/ProductFamilyInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context;
namespace Lc\CaracoleBundle\Model\Product;


interface ProductFamilyInterface interface ProductFamilyInterface
{ {

Model/Product/ProductFamily.php → Model/Product/ProductFamilyModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\Product;


use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Context\FilterMerchantInterface;
use Lc\ShopBundle\Context\PriceInterface;
use Lc\ShopBundle\Context\ProductInterface;
use Lc\ShopBundle\Context\ProductPropertyInterface;
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface;
use Lc\CaracoleBundle\Doctrine\Extension\PriceInterface;
use Lc\CaracoleBundle\Model\Product\ProductInterface;
use Lc\CaracoleBundle\Doctrine\Extension\ProductPropertyInterface;
use Gedmo\Mapping\Annotation as Gedmo; use Gedmo\Mapping\Annotation as Gedmo;




* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */


abstract class ProductFamily extends AbstractDocumentEntity implements ProductPropertyInterface, PriceInterface, FilterMerchantInterface
abstract class ProductFamilyModel extends AbstractDocumentEntity implements ProductPropertyInterface, PriceInterface, FilterMerchantInterface
{ {


use ProductPropertyTrait; use ProductPropertyTrait;


/** /**
* @Gedmo\Blameable(on="create") * @Gedmo\Blameable(on="create")
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UserInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\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\ShopBundle\Context\UserInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface")
* @ORM\JoinColumn(nullable=true) * @ORM\JoinColumn(nullable=true)
*/ */
protected $updatedBy; protected $updatedBy;


/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\MerchantInterface", inversedBy="productFamilies")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface", inversedBy="productFamilies")
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $merchant; protected $merchant;


/** /**
* @ORM\ManyToMany(targetEntity="Lc\ShopBundle\Context\ProductCategoryInterface", inversedBy="productFamilies")
* @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\Product\ProductCategoryInterface", inversedBy="productFamilies")
*/ */
protected $productCategories; protected $productCategories;


protected $quantityLabel; protected $quantityLabel;


/** /**
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\ProductInterface", mappedBy="productFamily", orphanRemoval=true, cascade={"persist"})
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Product\ProductInterface", mappedBy="productFamily", orphanRemoval=true, cascade={"persist"})
* @ORM\OrderBy({"position" = "ASC"}) * @ORM\OrderBy({"position" = "ASC"})
*/ */
protected $products; protected $products;


/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\TaxRateInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Common\TaxRateInterface")
*/ */
protected $supplierTaxRate; protected $supplierTaxRate;


protected $saleStatus; protected $saleStatus;


/** /**
* @ORM\ManyToMany(targetEntity="Lc\ShopBundle\Context\SectionInterface", inversedBy="productFamilies")
* @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\Section\SectionInterface", inversedBy="productFamilies")
*/ */
protected $sections; protected $sections;


return $this; return $this;
} }
/** /**
* @return Collection|ProductCategory[]
* @return Collection|ProductCategoryModel[]
*/ */
public function getProductCategories(): Collection public function getProductCategories(): Collection
{ {
$this->productCategories = new ArrayCollection(); $this->productCategories = new ArrayCollection();
} }


public function addProductCategory(ProductCategory $productCategory): self
public function addProductCategory(ProductCategoryModel $productCategory): self
{ {
if (!$this->productCategories->contains($productCategory)) { if (!$this->productCategories->contains($productCategory)) {
$this->productCategories[] = $productCategory; $this->productCategories[] = $productCategory;
return $this; return $this;
} }


public function removeProductCategory(ProductCategory $productCategory): self
public function removeProductCategory(ProductCategoryModel $productCategory): self
{ {
if ($this->productCategories->contains($productCategory)) { if ($this->productCategories->contains($productCategory)) {
$this->productCategories->removeElement($productCategory); $this->productCategories->removeElement($productCategory);

+ 1
- 1
Model/Product/ProductInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context;
namespace Lc\CaracoleBundle\Model\Product;


interface ProductInterface interface ProductInterface
{ {

Model/Product/Product.php → Model/Product/ProductModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\Product;


use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Context\OrderProductInterface;
use Lc\ShopBundle\Context\PriceInterface;
use Lc\ShopBundle\Context\ProductInterface;
use Lc\ShopBundle\Context\ProductPropertyInterface;
use Lc\ShopBundle\Context\SortableInterface;
use Lc\ShopBundle\Services\Price;
use Lc\CaracoleBundle\Model\Order\OrderProductInterface;
use Lc\CaracoleBundle\Doctrine\Extension\PriceInterface;
use Lc\CaracoleBundle\Model\Product\ProductInterface;
use Lc\CaracoleBundle\Doctrine\Extension\ProductPropertyInterface;
use Lc\CaracoleBundle\Doctrine\Extension\SortableInterface;
use Lc\CaracoleBundle\Services\Price;
use Gedmo\Mapping\Annotation as Gedmo; use Gedmo\Mapping\Annotation as Gedmo;


/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */
abstract class Product extends AbstractEntity implements SortableInterface, ProductPropertyInterface, PriceInterface
abstract class ProductModel extends AbstractEntity implements SortableInterface, ProductPropertyInterface, PriceInterface
{ {
use SortableTrait; use SortableTrait;
use ProductPropertyTrait; use ProductPropertyTrait;


/** /**
* @Gedmo\Blameable(on="create") * @Gedmo\Blameable(on="create")
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UserInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\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\ShopBundle\Context\UserInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface")
* @ORM\JoinColumn(nullable=true) * @ORM\JoinColumn(nullable=true)
*/ */
protected $updatedBy; protected $updatedBy;


/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\ProductFamilyInterface", inversedBy="products", cascade={"persist"})
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Product\ProductFamilyInterface", inversedBy="products", cascade={"persist"})
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $productFamily; protected $productFamily;
public function getAvailableQuantityInherited() public function getAvailableQuantityInherited()
{ {
switch ($this->getProductFamily()->getBehaviorCountStock()) { switch ($this->getProductFamily()->getBehaviorCountStock()) {
case ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT_FAMILY :
case ProductFamily::BEHAVIOR_COUNT_STOCK_BY_MEASURE :
case ProductFamilyModel::BEHAVIOR_COUNT_STOCK_BY_PRODUCT_FAMILY :
case ProductFamilyModel::BEHAVIOR_COUNT_STOCK_BY_MEASURE :
return $this->getProductFamily()->getAvailableQuantity(); return $this->getProductFamily()->getAvailableQuantity();
break; break;
case ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT :
case ProductFamilyModel::BEHAVIOR_COUNT_STOCK_BY_PRODUCT :
return $this->getAvailableQuantity(); return $this->getAvailableQuantity();
break; break;
case ProductFamily::BEHAVIOR_COUNT_STOCK_UNLIMITED :
case ProductFamilyModel::BEHAVIOR_COUNT_STOCK_UNLIMITED :
return false; return false;
break; break;
} }
return $this->getProductFamily()->getTaxRateInherited(); return $this->getProductFamily()->getTaxRateInherited();
} }


public function getProductFamily(): ?ProductFamily
public function getProductFamily(): ?ProductFamilyModel
{ {
return $this->productFamily; return $this->productFamily;
} }


public function setProductFamily(?ProductFamily $productFamily): self
public function setProductFamily(?ProductFamilyModel $productFamily): self
{ {
$this->productFamily = $productFamily; $this->productFamily = $productFamily;



+ 2
- 2
Model/Reduction/ReductionCartInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context;
namespace Lc\CaracoleBundle\Model\Reduction;


use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Lc\ShopBundle\Model\PointSale;
use Lc\CaracoleBundle\Model\PointSale;


interface ReductionCartInterface interface ReductionCartInterface
{ {

Model/Reduction/ReductionCart.php → Model/Reduction/ReductionCartModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\Reduction;


use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Context\FilterMerchantInterface;
use Lc\ShopBundle\Context\OrderAmountMinInterface;
use Lc\ShopBundle\Context\ReductionCartPropertyInterface;
use Lc\ShopBundle\Context\ReductionInterface;
use Lc\ShopBundle\Context\ReductionPropertyInterface;
use Lc\ShopBundle\Context\StatusInterface;
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface;
use Lc\CaracoleBundle\Doctrine\Extension\OrderAmountMinInterface;
use Lc\CaracoleBundle\Doctrine\Extension\ReductionCartPropertyInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionInterface;
use Lc\CaracoleBundle\Doctrine\Extension\ReductionPropertyInterface;
use Lc\SovBundle\Doctrine\Extension\StatusInterface;


/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */
abstract class ReductionCart extends AbstractEntity implements ReductionPropertyInterface, ReductionInterface, ReductionCartPropertyInterface, FilterMerchantInterface, OrderAmountMinInterface, StatusInterface
abstract class ReductionCartModel extends AbstractEntity implements ReductionPropertyInterface, ReductionInterface, ReductionCartPropertyInterface, FilterMerchantInterface, OrderAmountMinInterface, StatusInterface
{ {


const APPLIED_TO_DELIVERY = 'delivery'; const APPLIED_TO_DELIVERY = 'delivery';
protected $title; protected $title;


/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\MerchantInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface")
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $merchant; protected $merchant;
protected $availableQuantityPerUser; protected $availableQuantityPerUser;


/** /**
* @ORM\ManyToMany(targetEntity="Lc\ShopBundle\Context\PointSaleInterface")
* @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\PointSale\PointSaleInterface")
*/ */
protected $pointSales; protected $pointSales;


/** /**
* @ORM\ManyToMany(targetEntity="Lc\ShopBundle\Context\ReductionCartInterface")
* @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\Reduction\ReductionCartInterface")
*/ */
protected $uncombinables; protected $uncombinables;



+ 1
- 1
Model/Reduction/ReductionCatalogInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context;
namespace Lc\CaracoleBundle\Model\Reduction;


interface ReductionCatalogInterface interface ReductionCatalogInterface
{ {

Model/Reduction/ReductionCatalog.php → Model/Reduction/ReductionCatalogModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\Reduction;


use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Context\FilterMerchantInterface;
use Lc\ShopBundle\Context\ReductionCatalogInterface;
use Lc\ShopBundle\Context\ReductionInterface;
use Lc\ShopBundle\Context\ReductionPropertyInterface;
use Lc\ShopBundle\Context\StatusInterface;
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionCatalogInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionInterface;
use Lc\CaracoleBundle\Doctrine\Extension\ReductionPropertyInterface;
use Lc\SovBundle\Doctrine\Extension\StatusInterface;
use phpDocumentor\Reflection\Types\Integer; use phpDocumentor\Reflection\Types\Integer;


/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */
abstract class ReductionCatalog extends AbstractEntity implements ReductionCatalogInterface, ReductionPropertyInterface, FilterMerchantInterface, StatusInterface
abstract class ReductionCatalogModel extends AbstractEntity implements ReductionCatalogInterface, ReductionPropertyInterface, FilterMerchantInterface, StatusInterface
{ {
use StatusTrait; use StatusTrait;
use ReductionTrait; use ReductionTrait;
protected $title; protected $title;


/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\MerchantInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface")
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $merchant; protected $merchant;


/** /**
* @ORM\ManyToMany(targetEntity="Lc\ShopBundle\Context\ProductFamilyInterface")
* @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\Product\ProductFamilyInterface")
*/ */
protected $productFamilies; protected $productFamilies;


/** /**
* @ORM\OneToOne(targetEntity="Lc\ShopBundle\Context\ProductFamilyInterface")
* @ORM\OneToOne(targetEntity="Lc\CaracoleBundle\Model\Product\ProductFamilyInterface")
*/ */
protected $productFamily; protected $productFamily;


/** /**
* @ORM\ManyToMany(targetEntity="Lc\ShopBundle\Context\ProductCategoryInterface")
* @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\Product\ProductCategoryInterface")
*/ */
protected $productCategories; protected $productCategories;



+ 1
- 1
Model/Reduction/ReductionCreditInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context;
namespace Lc\CaracoleBundle\Model\Reduction;


interface ReductionCreditInterface interface ReductionCreditInterface
{ {

Model/Reduction/ReductionCredit.php → Model/Reduction/ReductionCreditModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\Reduction;


use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Context\FilterMerchantInterface;
use Lc\ShopBundle\Context\ReductionInterface;
use Lc\ShopBundle\Context\ReductionPropertyInterface;
use Lc\ShopBundle\Context\StatusInterface;
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionPropertyInterface;
use Lc\SovBundle\Doctrine\Extension\StatusInterface;


/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */
abstract class ReductionCredit extends AbstractEntity implements ReductionInterface, FilterMerchantInterface, StatusInterface
abstract class ReductionCreditModel extends AbstractEntity implements ReductionInterface, FilterMerchantInterface, StatusInterface
{ {
const TYPE_CREDIT = 'credit'; const TYPE_CREDIT = 'credit';
const TYPE_GIFT = 'gift'; const TYPE_GIFT = 'gift';
protected $title; protected $title;


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




/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\MerchantInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface")
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $merchant; protected $merchant;
protected $sended; protected $sended;


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



+ 1
- 1
Model/Reminder/ReminderInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context;
namespace Lc\CaracoleBundle\Model\Reminder;


interface ReminderInterface interface ReminderInterface
{ {

Model/Reminder/Reminder.php → Model/Reminder/ReminderModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\Reminder;


use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Context\FilterMerchantInterface;
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface;


/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */
abstract class Reminder extends AbstractEntity implements FilterMerchantInterface
abstract class ReminderModel extends AbstractEntity implements FilterMerchantInterface
{ {
public $relatedPage; public $relatedPage;


/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\MerchantInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface")
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $merchant; protected $merchant;
protected $entityAction; protected $entityAction;


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



+ 1
- 1
Model/Section/SectionInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context;
namespace Lc\CaracoleBundle\Model\Section;


interface SectionInterface interface SectionInterface
{ {

Model/Section/Section.php → Model/Section/SectionModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\Section;


use App\Entity\Hub; use App\Entity\Hub;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Context\FilterMerchantInterface;
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface;


/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */
abstract class Section extends AbstractDocumentEntity implements FilterMerchantInterface
abstract class SectionModel extends AbstractDocumentEntity implements FilterMerchantInterface
{ {
/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\MerchantInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface")
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $merchant; protected $merchant;
const SECTION_CYCLE_YEAR = 'year' ; const SECTION_CYCLE_YEAR = 'year' ;


/** /**
* @ORM\ManyToMany(targetEntity="Lc\ShopBundle\Context\ProductFamilyInterface", mappedBy="sections")
* @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\Product\ProductFamilyInterface", mappedBy="sections")
*/ */
protected $productFamilies; protected $productFamilies;


/** /**
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\OrderShopInterface", mappedBy="section")
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Order\OrderShopInterface", mappedBy="section")
*/ */
protected $orderShops; protected $orderShops;




/** /**
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\ProductCategoryInterface", mappedBy="section")
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Product\ProductCategoryInterface", mappedBy="section")
*/ */
protected $productCategories; protected $productCategories;



+ 1
- 1
Model/Site/NewsInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context ;
namespace Lc\CaracoleBundle\Model\Site ;


interface NewsInterface interface NewsInterface
{ {

Model/Site/News.php → Model/Site/NewsModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\Site;


use App\Entity\Hub; use App\Entity\Hub;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Context\FilterMerchantInterface;
use Lc\ShopBundle\Model\AbstractDocumentEntity;
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface;
use Lc\CaracoleBundle\Model\AbstractDocumentEntity;
use Gedmo\Mapping\Annotation as Gedmo; use Gedmo\Mapping\Annotation as Gedmo;


/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */
abstract class News extends AbstractDocumentEntity implements FilterMerchantInterface
abstract class NewsModel extends AbstractDocumentEntity implements FilterMerchantInterface
{ {
/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\MerchantInterface", inversedBy="news")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface", inversedBy="news")
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $merchant; protected $merchant;

+ 1
- 1
Model/Site/PageInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context;
namespace Lc\CaracoleBundle\Model\Site;


interface PageInterface interface PageInterface
{ {

Model/Site/Page.php → Model/Site/PageModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\Site;


use App\Entity\Hub; use App\Entity\Hub;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Context\FilterMerchantInterface;
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface;


/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */
abstract class Page extends AbstractDocumentEntity implements FilterMerchantInterface
abstract class PageModel extends AbstractDocumentEntity implements FilterMerchantInterface
{ {
/** /**
* @ORM\Column(type="text", nullable=true) * @ORM\Column(type="text", nullable=true)
protected $content; protected $content;


/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\MerchantInterface", inversedBy="pages")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface", inversedBy="pages")
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $merchant; protected $merchant;

+ 1
- 1
Model/Ticket/TicketInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context ;
namespace Lc\CaracoleBundle\Model\Ticket ;


interface TicketInterface interface TicketInterface
{ {

+ 1
- 1
Model/Ticket/TicketMessageInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context ;
namespace Lc\CaracoleBundle\Model\Ticket ;


interface TicketMessageInterface interface TicketMessageInterface
{ {

Model/Ticket/TicketMessage.php → Model/Ticket/TicketMessageModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\Ticket;


use App\Entity\Ticket;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Context\TicketInterface;
use Lc\CaracoleBundle\Model\Ticket\TicketInterface;
use Gedmo\Mapping\Annotation as Gedmo; use Gedmo\Mapping\Annotation as Gedmo;


/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */
abstract class TicketMessage extends AbstractEntity
abstract class TicketMessageModel extends AbstractEntity
{ {
use StatusTrait; use StatusTrait;


/** /**
* @Gedmo\Blameable(on="create") * @Gedmo\Blameable(on="create")
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UserInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\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\ShopBundle\Context\UserInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface")
* @ORM\JoinColumn(nullable=true) * @ORM\JoinColumn(nullable=true)
*/ */
protected $updatedBy; protected $updatedBy;
protected $message; protected $message;


/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\TicketInterface", inversedBy="ticketMessages")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Ticket\TicketInterface", inversedBy="ticketMessages")
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $ticket; protected $ticket;

Model/Ticket/Ticket.php → Model/Ticket/TicketModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\Ticket;


use App\Entity\TicketMessage; use App\Entity\TicketMessage;
use App\Entity\User; use App\Entity\User;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Context\FilterMerchantInterface;
use Lc\ShopBundle\Context\MerchantInterface;
use Lc\ShopBundle\Context\OrderShopInterface;
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Order\OrderShopInterface;
use Gedmo\Mapping\Annotation as Gedmo; use Gedmo\Mapping\Annotation as Gedmo;
use Lc\ShopBundle\Context\UserInterface;
use Lc\CaracoleBundle\Model\User\UserInterface;


/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */
abstract class Ticket extends AbstractEntity implements FilterMerchantInterface
abstract class TicketModel extends AbstractEntity implements FilterMerchantInterface
{ {
const TYPE_PRODUCT_UNAVAILABLE = 'product-unavailable' ; const TYPE_PRODUCT_UNAVAILABLE = 'product-unavailable' ;
const TYPE_PRODUCT_ERROR = 'product-error' ; const TYPE_PRODUCT_ERROR = 'product-error' ;


/** /**
* @Gedmo\Blameable(on="create") * @Gedmo\Blameable(on="create")
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UserInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\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\ShopBundle\Context\UserInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface")
* @ORM\JoinColumn(nullable=true) * @ORM\JoinColumn(nullable=true)
*/ */
protected $updatedBy; protected $updatedBy;


/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\MerchantInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface")
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $merchant; protected $merchant;
protected $status; protected $status;


/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\OrderShopInterface", inversedBy="tickets")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Order\OrderShopInterface", inversedBy="tickets")
*/ */
protected $orderShop; protected $orderShop;


protected $visitorToken; protected $visitorToken;


/** /**
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\TicketMessageInterface", mappedBy="ticket", orphanRemoval=true)
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Ticket\TicketMessageInterface", mappedBy="ticket", orphanRemoval=true)
* @ORM\OrderBy({"id" = "ASC"}) * @ORM\OrderBy({"id" = "ASC"})
*/ */
protected $ticketMessages; protected $ticketMessages;


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



+ 1
- 1
Model/User/GroupUserInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context;
namespace Lc\CaracoleBundle\Model\User;


interface GroupUserInterface interface GroupUserInterface
{ {

Model/User/GroupUser.php → Model/User/GroupUserModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\User;


use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Lc\ShopBundle\Context\FilterMerchantInterface;
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface;




/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */
abstract class GroupUser extends AbstractDocumentEntity implements FilterMerchantInterface
abstract class GroupUserModel extends AbstractDocumentEntity implements FilterMerchantInterface
{ {


/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\MerchantInterface", inversedBy="groupUsers")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface", inversedBy="groupUsers")
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $merchant; protected $merchant;


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


} }


/** /**
* @return Collection|User[]
* @return Collection|UserModel[]
*/ */
public function getUsers(): Collection public function getUsers(): Collection
{ {
return $this->users; return $this->users;
} }


public function addUser(User $user): self
public function addUser(UserModel $user): self
{ {
if (!$this->users->contains($user)) { if (!$this->users->contains($user)) {
$this->users[] = $user; $this->users[] = $user;
return $this; return $this;
} }


public function removeUser(User $user): self
public function removeUser(UserModel $user): self
{ {
if ($this->users->contains($user)) { if ($this->users->contains($user)) {
$this->users->removeElement($user); $this->users->removeElement($user);

+ 1
- 1
Model/User/UserInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context;
namespace Lc\CaracoleBundle\Model\User;


interface UserInterface interface UserInterface
{ {

+ 1
- 1
Model/User/UserMerchantInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context;
namespace Lc\CaracoleBundle\Model\User;


interface UserMerchantInterface interface UserMerchantInterface
{ {

Model/User/UserMerchant.php → Model/User/UserMerchantModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\User;


use App\Entity\CreditHistory; use App\Entity\CreditHistory;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Context\CreditHistoryInterface;
use Lc\ShopBundle\Context\FilterMerchantInterface;
use Lc\CaracoleBundle\Model\Credit\CreditHistoryInterface;
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface;


/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
* *
*/ */
abstract class UserMerchant implements FilterMerchantInterface
abstract class UserMerchantModel implements FilterMerchantInterface
{ {
/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UserInterface", inversedBy="userMerchants")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface", inversedBy="userMerchants")
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $user; protected $user;


/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\MerchantInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface")
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $merchant; protected $merchant;
protected $creditActive; protected $creditActive;


/** /**
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\CreditHistoryInterface", mappedBy="userMerchant", orphanRemoval=true)
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Credit\CreditHistoryInterface", mappedBy="userMerchant", orphanRemoval=true)
*/ */
protected $creditHistories; protected $creditHistories;


$this->creditHistories = new ArrayCollection(); $this->creditHistories = new ArrayCollection();
} }


public function getUser(): ?User
public function getUser(): ?UserModel
{ {
return $this->user; return $this->user;
} }


public function setUser(?User $user): self
public function setUser(?UserModel $user): self
{ {
$this->user = $user; $this->user = $user;



Model/User/User.php → Model/User/UserModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\User;


use App\Entity\Newsletter; use App\Entity\Newsletter;
use App\Entity\Ticket; use App\Entity\Ticket;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo; use Gedmo\Mapping\Annotation as Gedmo;
use Lc\SovBundle\Model\User\User as SovUserModel; use Lc\SovBundle\Model\User\User as SovUserModel;
use Lc\ShopBundle\Context\MerchantInterface;
use Lc\ShopBundle\Context\TicketInterface;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Ticket\TicketInterface;


/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
* *
*/ */
abstract class User extends SovUserModel
abstract class UserModel extends SovUserModel
{ {
/** /**
* @ORM\Column(type="string", length=20, nullable=true) * @ORM\Column(type="string", length=20, nullable=true)
protected $behaviorDisplayPrice; protected $behaviorDisplayPrice;


/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\MerchantInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface")
*/ */
protected $merchant; protected $merchant;


/** /**
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\AddressInterface", mappedBy="user", cascade={"persist"})
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Address\AddressInterface", mappedBy="user", cascade={"persist"})
*/ */
protected $addresses; protected $addresses;


/** /**
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\OrderShopInterface", mappedBy="user")
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Order\OrderShopInterface", mappedBy="user")
*/ */
protected $orders; protected $orders;


protected $gender; protected $gender;


/** /**
* @ORM\ManyToMany(targetEntity="Lc\ShopBundle\Context\NewsletterInterface", inversedBy="users")
* @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\Newsletter\NewsletterInterface", inversedBy="users")
*/ */
protected $newsletters; protected $newsletters;


/** /**
* @ORM\ManyToMany(targetEntity="Lc\ShopBundle\Context\GroupUserInterface", inversedBy="users")
* @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\User\GroupUserInterface", inversedBy="users")
*/ */
protected $groupUsers; protected $groupUsers;


/** /**
* @ORM\ManyToMany(targetEntity="Lc\ShopBundle\Context\ProductFamilyInterface")
* @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\Product\ProductFamilyInterface")
*/ */
protected $favoriteProductFamilies; protected $favoriteProductFamilies;


/** /**
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\UserPointSaleInterface", mappedBy="user", orphanRemoval=true)
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\User\UserPointSaleInterface", mappedBy="user", orphanRemoval=true)
*/ */
protected $userPointSales; protected $userPointSales;


/** /**
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\UserMerchantInterface", mappedBy="user", orphanRemoval=true)
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\User\UserMerchantInterface", mappedBy="user", orphanRemoval=true)
*/ */
protected $userMerchants; protected $userMerchants;


/** /**
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\TicketInterface", mappedBy="user")
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Ticket\TicketInterface", mappedBy="user")
*/ */
protected $tickets; protected $tickets;






/** /**
* @ORM\ManyToMany(targetEntity="Lc\ShopBundle\Context\ReductionCreditInterface", mappedBy="users")
* @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\Reduction\ReductionCreditInterface", mappedBy="users")
*/ */
protected $reductionCredits; protected $reductionCredits;


} }


/** /**
* @return Collection|GroupUser[]
* @return Collection|GroupUserModel[]
*/ */
public function getGroupUsers(): Collection public function getGroupUsers(): Collection
{ {
return $this->groupUsers; return $this->groupUsers;
} }


public function addGroupUser(GroupUser $groupUser): self
public function addGroupUser(GroupUserModel $groupUser): self
{ {
if (!$this->groupUsers->contains($groupUser)) { if (!$this->groupUsers->contains($groupUser)) {
$this->groupUsers[] = $groupUser; $this->groupUsers[] = $groupUser;
return $this; return $this;
} }


public function removeGroupUser(GroupUser $groupUser): self
public function removeGroupUser(GroupUserModel $groupUser): self
{ {
if ($this->groupUsers->contains($groupUser)) { if ($this->groupUsers->contains($groupUser)) {
$this->groupUsers->removeElement($groupUser); $this->groupUsers->removeElement($groupUser);
} }


/** /**
* @return Collection|UserPointSale[]
* @return Collection|UserPointSaleModel[]
*/ */
public function getUserPointSales(): Collection public function getUserPointSales(): Collection
{ {

+ 1
- 1
Model/User/UserPointSaleInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context;
namespace Lc\CaracoleBundle\Model\User;


interface UserPointSaleInterface interface UserPointSaleInterface
{ {

Model/User/UserPointSale.php → Model/User/UserPointSaleModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\User;


use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;


/** /**
* @ORM\MappedSuperclass * @ORM\MappedSuperclass
*/ */
abstract class UserPointSale
abstract class UserPointSaleModel
{ {
/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UserInterface", inversedBy="userPointSales")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserInterface", inversedBy="userPointSales")
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $user; protected $user;


/** /**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\PointSaleInterface", inversedBy="userPointSales")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\PointSale\PointSaleInterface", inversedBy="userPointSales")
* @ORM\JoinColumn(nullable=false) * @ORM\JoinColumn(nullable=false)
*/ */
protected $pointSale; protected $pointSale;
*/ */
protected $comment; protected $comment;


public function getUser(): ?User
public function getUser(): ?UserModel
{ {
return $this->user; return $this->user;
} }


public function setUser(?User $user): self
public function setUser(?UserModel $user): self
{ {
$this->user = $user; $this->user = $user;



+ 0
- 8
Model/User/UserUtilsInterface.php View File

<?php

namespace Lc\ShopBundle\Context;

interface UserUtilsInterface
{

}

+ 1
- 1
Model/User/VisitorInterface.php View File

<?php <?php


namespace Lc\ShopBundle\Context;
namespace Lc\CaracoleBundle\Model\User;


interface VisitorInterface interface VisitorInterface
{ {

Model/User/Visitor.php → Model/User/VisitorModel.php View File

<?php <?php


namespace Lc\ShopBundle\Model;
namespace Lc\CaracoleBundle\Model\User;


use App\Entity\OrderShop; use App\Entity\OrderShop;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */
abstract class Visitor
abstract class VisitorModel
{ {
/** /**
* @ORM\Column(type="string", length=255) * @ORM\Column(type="string", length=255)
protected $totalVisit; protected $totalVisit;


/** /**
* @ORM\OneToMany(targetEntity="App\Entity\OrderShop", mappedBy="visitor")
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Order\OrderShop", mappedBy="visitor")
*/ */
protected $orders; protected $orders;



Loading…
Cancel
Save