first commit
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace KupShop\SalesBundle\Entity\Wrapper;
|
||||
|
||||
use KupShop\KupShopBundle\Template\ObjectWrapper;
|
||||
use KupShop\SalesBundle\Entity\SaleItem;
|
||||
|
||||
class SaleItemWrapper extends ObjectWrapper
|
||||
{
|
||||
/** @var SaleItem */
|
||||
protected $object;
|
||||
|
||||
public static $objectType = SaleItem::class;
|
||||
|
||||
public function field_id_product(): ?int
|
||||
{
|
||||
return $this->object->productId;
|
||||
}
|
||||
|
||||
public function field_id_variation(): ?int
|
||||
{
|
||||
return $this->object->variationId;
|
||||
}
|
||||
|
||||
public function field_product(): ?\Product
|
||||
{
|
||||
return $this->object->getProduct();
|
||||
}
|
||||
}
|
||||
26
bundles/KupShop/SalesBundle/Entity/Wrapper/SaleWrapper.php
Normal file
26
bundles/KupShop/SalesBundle/Entity/Wrapper/SaleWrapper.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace KupShop\SalesBundle\Entity\Wrapper;
|
||||
|
||||
use KupShop\KupShopBundle\Template\ObjectWrapper;
|
||||
use KupShop\SalesBundle\Entity\Sale;
|
||||
|
||||
class SaleWrapper extends ObjectWrapper
|
||||
{
|
||||
/** @var Sale */
|
||||
protected $object;
|
||||
|
||||
public static $objectType = Sale::class;
|
||||
|
||||
public function field_user(): ?\User
|
||||
{
|
||||
return $this->object->getUser();
|
||||
}
|
||||
|
||||
public function field_deliveryType(): ?\DeliveryType
|
||||
{
|
||||
return $this->object->getDeliveryType();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user