@@ -0,0 +1 @@ | |||
#Laclic LcShopBundle |
@@ -0,0 +1,12 @@ | |||
<?php | |||
namespace Lc\ShopBundle\Context; | |||
use Doctrine\ORM\Mapping as ORM; | |||
use Gedmo\Mapping\Annotation as Gedmo; | |||
interface MerchantInterface | |||
{ | |||
} |
@@ -1,6 +1,6 @@ | |||
<?php | |||
namespace Lc\ShopBundle\Model; | |||
namespace Lc\ShopBundle\Context; | |||
use Doctrine\ORM\Mapping as ORM; | |||
use Gedmo\Mapping\Annotation as Gedmo; |
@@ -0,0 +1,118 @@ | |||
<?php | |||
namespace Lc\ShopBundle\Model; | |||
use Doctrine\ORM\Mapping as ORM; | |||
use Gedmo\Mapping\Annotation as Gedmo; | |||
use Lc\ShopBundle\Model\AbstractEntity; | |||
/** | |||
* @ORM\MappedSuperclass | |||
*/ | |||
abstract class AbstractDocumentEntity extends AbstractEntity | |||
{ | |||
/** | |||
* @ORM\Column(type="string", length=255) | |||
*/ | |||
private $title; | |||
/** | |||
* @ORM\Column(type="string", length=255) | |||
* @Gedmo\Slug(fields={"title"}) | |||
*/ | |||
private $slug; | |||
/** | |||
* @ORM\Column(type="text", nullable=true) | |||
*/ | |||
private $description; | |||
/** | |||
* @ORM\Column(type="string", length=255, nullable=true) | |||
*/ | |||
private $image; | |||
/** | |||
* @ORM\Column(type="float") | |||
*/ | |||
private $status; | |||
/** | |||
* @ORM\Column(type="integer") | |||
* @Gedmo\SortablePosition() | |||
*/ | |||
private $position; | |||
public function getTitle(): ?string | |||
{ | |||
return $this->title; | |||
} | |||
public function setTitle(string $title): self | |||
{ | |||
$this->title = $title; | |||
return $this; | |||
} | |||
public function getSlug(): ?string | |||
{ | |||
return $this->slug; | |||
} | |||
public function setSlug(string $slug): self | |||
{ | |||
$this->slug = $slug; | |||
return $this; | |||
} | |||
public function getDescription(): ?string | |||
{ | |||
return $this->description; | |||
} | |||
public function setDescription(?string $description): self | |||
{ | |||
$this->description = $description; | |||
return $this; | |||
} | |||
public function getImage(): ?string | |||
{ | |||
return $this->image; | |||
} | |||
public function setImage(?string $image): self | |||
{ | |||
$this->image = $image; | |||
return $this; | |||
} | |||
public function getStatus(): ?float | |||
{ | |||
return $this->status; | |||
} | |||
public function setStatus(float $status): self | |||
{ | |||
$this->status = $status; | |||
return $this; | |||
} | |||
public function getPosition(): ?int | |||
{ | |||
return $this->position; | |||
} | |||
public function setPosition(int $position): self | |||
{ | |||
$this->position = $position; | |||
return $this; | |||
} | |||
} |
@@ -4,6 +4,7 @@ namespace Lc\ShopBundle\Model; | |||
use Doctrine\ORM\Mapping as ORM; | |||
use Gedmo\Mapping\Annotation as Gedmo; | |||
use Lc\ShopBundle\Context\UserInterface; | |||
/** | |||
* @ORM\MappedSuperclass | |||
@@ -24,13 +25,13 @@ abstract class AbstractEntity | |||
protected $updatedAt; | |||
/** | |||
* @ORM\ManyToOne(targetEntity="UserInterface") | |||
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UserInterface") | |||
* @ORM\JoinColumn(nullable=false) | |||
*/ | |||
protected $createdBy; | |||
/** | |||
* @ORM\ManyToOne(targetEntity="UserInterface") | |||
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UserInterface") | |||
* @ORM\JoinColumn(nullable=false) | |||
*/ | |||
protected $updatedBy; |
@@ -9,7 +9,7 @@ use Gedmo\Mapping\Annotation as Gedmo; | |||
* @ORM\MappedSuperclass() | |||
*/ | |||
class Merchant | |||
abstract class Merchant extends AbstractDocumentEntity | |||
{ | |||
} |
@@ -0,0 +1,68 @@ | |||
<?php | |||
namespace Lc\ShopBundle\Model; | |||
use Doctrine\ORM\Mapping as ORM; | |||
use FOS\UserBundle\Model\User as UserModelFOS; | |||
use Lc\ShopBundle\Context\MerchantInterface; | |||
/** | |||
* @ORM\MappedSuperclass() | |||
*/ | |||
abstract class User //extends UserModelFOS | |||
{ | |||
/** | |||
* @ORM\Column(type="string", length=20, nullable=true) | |||
*/ | |||
protected $phone; | |||
/** | |||
* @ORM\Column(type="string", length=64, nullable=true) | |||
*/ | |||
protected $behaviorDisplayPrice; | |||
/** | |||
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\MerchantInterface") | |||
*/ | |||
protected $merchant; | |||
public function getPhone(): ?string | |||
{ | |||
return $this->phone; | |||
} | |||
public function setPhone(?string $phone): self | |||
{ | |||
$this->phone = $phone; | |||
return $this; | |||
} | |||
public function getBehaviorDisplayPrice(): ?string | |||
{ | |||
return $this->behaviorDisplayPrice; | |||
} | |||
public function setBehaviorDisplayPrice(?string $behaviorDisplayPrice): self | |||
{ | |||
$this->behaviorDisplayPrice = $behaviorDisplayPrice; | |||
return $this; | |||
} | |||
public function getMerchant(): ?MerchantInterface | |||
{ | |||
return $this->merchant; | |||
} | |||
public function setMerchant(?MerchantInterface $merchant): self | |||
{ | |||
$this->merchant = $merchant; | |||
return $this; | |||
} | |||
} |