#Laclic LcShopBundle |
<?php | |||||
namespace Lc\ShopBundle\Context; | |||||
use Doctrine\ORM\Mapping as ORM; | |||||
use Gedmo\Mapping\Annotation as Gedmo; | |||||
interface MerchantInterface | |||||
{ | |||||
} |
<?php | <?php | ||||
namespace Lc\ShopBundle\Model; | |||||
namespace Lc\ShopBundle\Context; | |||||
use Doctrine\ORM\Mapping as ORM; | use Doctrine\ORM\Mapping as ORM; | ||||
use Gedmo\Mapping\Annotation as Gedmo; | use Gedmo\Mapping\Annotation as Gedmo; |
<?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; | |||||
} | |||||
} |
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\ShopBundle\Context\UserInterface; | |||||
/** | /** | ||||
* @ORM\MappedSuperclass | * @ORM\MappedSuperclass | ||||
protected $updatedAt; | protected $updatedAt; | ||||
/** | /** | ||||
* @ORM\ManyToOne(targetEntity="UserInterface") | |||||
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UserInterface") | |||||
* @ORM\JoinColumn(nullable=false) | * @ORM\JoinColumn(nullable=false) | ||||
*/ | */ | ||||
protected $createdBy; | protected $createdBy; | ||||
/** | /** | ||||
* @ORM\ManyToOne(targetEntity="UserInterface") | |||||
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UserInterface") | |||||
* @ORM\JoinColumn(nullable=false) | * @ORM\JoinColumn(nullable=false) | ||||
*/ | */ | ||||
protected $updatedBy; | protected $updatedBy; |
* @ORM\MappedSuperclass() | * @ORM\MappedSuperclass() | ||||
*/ | */ | ||||
class Merchant | |||||
abstract class Merchant extends AbstractDocumentEntity | |||||
{ | { | ||||
} | } |
<?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; | |||||
} | |||||
} |