2018-03-15 16:04:00 +01:00
|
|
|
<?php
|
|
|
|
|
2023-06-20 19:14:19 +02:00
|
|
|
namespace App\Entity;
|
2018-03-15 16:04:00 +01:00
|
|
|
|
2023-06-20 19:14:19 +02:00
|
|
|
use App\Traits\Commentable;
|
2018-03-15 16:04:00 +01:00
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
|
|
|
|
/**
|
2023-06-20 19:14:19 +02:00
|
|
|
* @ORM\Entity(repositoryClass="App\Repository\SellRecordRepository")
|
2018-03-15 16:04:00 +01:00
|
|
|
*/
|
|
|
|
class SellRecord {
|
2018-04-05 16:40:40 +02:00
|
|
|
|
|
|
|
use Commentable;
|
2018-03-15 16:04:00 +01:00
|
|
|
/**
|
2018-04-17 13:53:29 +02:00
|
|
|
* @ORM\Column(name="id", type="integer")
|
2018-03-15 16:04:00 +01:00
|
|
|
* @ORM\Id
|
2018-04-17 13:53:29 +02:00
|
|
|
* @ORM\GeneratedValue(strategy="AUTO")
|
2018-04-05 14:21:32 +02:00
|
|
|
*/
|
|
|
|
private $id;
|
2018-04-19 11:26:44 +02:00
|
|
|
/**
|
|
|
|
* gender of the client
|
|
|
|
* @ORM\Column( type = "string", nullable=true )
|
|
|
|
*/
|
|
|
|
private $gender;
|
2018-04-05 14:21:32 +02:00
|
|
|
/**
|
2018-04-06 15:54:59 +02:00
|
|
|
* liste des produits de la vente
|
2023-06-20 19:14:19 +02:00
|
|
|
* @ORM\OneToMany(targetEntity="App\Entity\ProductSold", mappedBy="sellRecords", cascade={"remove", "persist","detach"})
|
2018-04-06 15:54:59 +02:00
|
|
|
*/
|
|
|
|
private $productsSold;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* creation date
|
2018-03-15 16:04:00 +01:00
|
|
|
* @ORM\Column(type="datetime")
|
|
|
|
*/
|
|
|
|
private $date;
|
|
|
|
|
2018-04-05 14:21:32 +02:00
|
|
|
/**
|
2018-04-06 15:54:59 +02:00
|
|
|
* total
|
2018-04-06 16:39:41 +02:00
|
|
|
* @ORM\Column(type="decimal", scale=2, nullable=false)
|
2018-04-05 14:21:32 +02:00
|
|
|
*/
|
|
|
|
private $amount;
|
2018-04-06 16:39:41 +02:00
|
|
|
/**
|
|
|
|
* amount paid by client
|
|
|
|
* @ORM\Column(type="decimal", scale=2, nullable=true)
|
|
|
|
*/
|
|
|
|
private $paidByClient;
|
2018-04-05 14:21:32 +02:00
|
|
|
|
2018-04-05 15:05:04 +02:00
|
|
|
/**
|
|
|
|
* @var
|
2023-06-20 19:14:19 +02:00
|
|
|
* @ORM\ManyToOne(targetEntity="App\Entity\Festival",inversedBy="sellRecords")
|
2018-04-05 15:05:04 +02:00
|
|
|
*/
|
|
|
|
private $festival;
|
|
|
|
|
2018-04-05 16:40:40 +02:00
|
|
|
/**
|
2018-04-06 15:54:59 +02:00
|
|
|
* owner of the selling account
|
2023-06-20 19:14:19 +02:00
|
|
|
* @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="sellRecords")
|
2018-04-05 16:40:40 +02:00
|
|
|
*/
|
|
|
|
private $user;
|
|
|
|
|
2023-06-28 16:16:11 +02:00
|
|
|
#[ORM\ManyToOne(inversedBy: 'sellRecord')]
|
|
|
|
private ?Admin $admin = null;
|
|
|
|
|
2018-04-05 16:40:40 +02:00
|
|
|
|
2018-04-06 16:39:41 +02:00
|
|
|
/**
|
2018-04-17 13:53:29 +02:00
|
|
|
* Constructor
|
2018-04-06 16:39:41 +02:00
|
|
|
*/
|
2018-04-17 13:53:29 +02:00
|
|
|
public function __construct() {
|
2023-06-28 16:16:11 +02:00
|
|
|
$this->productsSold = new \Doctrine\Common\Collections\ArrayCollection();
|
|
|
|
}
|
2018-04-06 16:39:41 +02:00
|
|
|
|
2018-04-05 16:40:40 +02:00
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
2018-04-17 13:53:29 +02:00
|
|
|
public function getId() {
|
2023-06-28 16:16:11 +02:00
|
|
|
return $this->id;
|
|
|
|
}
|
2018-04-05 16:40:40 +02:00
|
|
|
|
|
|
|
/**
|
2018-04-17 13:53:29 +02:00
|
|
|
* @param mixed $id
|
2018-04-05 16:40:40 +02:00
|
|
|
*/
|
2018-04-17 13:53:29 +02:00
|
|
|
public function setId( $id ) {
|
2023-06-28 16:16:11 +02:00
|
|
|
$this->id = $id;
|
|
|
|
}
|
2018-04-05 15:05:04 +02:00
|
|
|
|
2018-04-05 16:40:40 +02:00
|
|
|
/**
|
2018-04-17 13:53:29 +02:00
|
|
|
* Set date
|
|
|
|
*
|
|
|
|
* @param \DateTime $date
|
|
|
|
*
|
|
|
|
* @return SellRecord
|
2018-04-05 16:40:40 +02:00
|
|
|
*/
|
2018-04-17 13:53:29 +02:00
|
|
|
public function setDate( $date ) {
|
2023-06-28 16:16:11 +02:00
|
|
|
$this->date = $date;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
2018-04-05 15:05:04 +02:00
|
|
|
|
|
|
|
/**
|
2018-04-17 13:53:29 +02:00
|
|
|
* Get date
|
|
|
|
*
|
|
|
|
* @return \DateTime
|
2018-04-05 15:05:04 +02:00
|
|
|
*/
|
2018-04-17 13:53:29 +02:00
|
|
|
public function getDate() {
|
2023-06-28 16:16:11 +02:00
|
|
|
return $this->date;
|
|
|
|
}
|
2018-04-05 15:05:04 +02:00
|
|
|
|
|
|
|
/**
|
2018-04-17 13:53:29 +02:00
|
|
|
* Set amount
|
|
|
|
*
|
|
|
|
* @param string $amount
|
|
|
|
*
|
|
|
|
* @return SellRecord
|
2018-04-05 15:05:04 +02:00
|
|
|
*/
|
2018-04-17 13:53:29 +02:00
|
|
|
public function setAmount( $amount ) {
|
2023-06-28 16:16:11 +02:00
|
|
|
$this->amount = $amount;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
2018-04-05 15:05:04 +02:00
|
|
|
|
2018-04-05 14:21:32 +02:00
|
|
|
/**
|
2018-04-17 13:53:29 +02:00
|
|
|
* Get amount
|
|
|
|
*
|
|
|
|
* @return string
|
2018-04-05 14:21:32 +02:00
|
|
|
*/
|
|
|
|
public function getAmount() {
|
2023-06-28 16:16:11 +02:00
|
|
|
return $this->amount;
|
|
|
|
}
|
2018-04-05 14:21:32 +02:00
|
|
|
|
|
|
|
/**
|
2018-04-17 13:53:29 +02:00
|
|
|
* Set paidByClient
|
|
|
|
*
|
|
|
|
* @param string $paidByClient
|
|
|
|
*
|
|
|
|
* @return SellRecord
|
2018-04-05 14:21:32 +02:00
|
|
|
*/
|
2018-04-17 13:53:29 +02:00
|
|
|
public function setPaidByClient( $paidByClient ) {
|
2023-06-28 16:16:11 +02:00
|
|
|
$this->paidByClient = $paidByClient;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
2018-03-15 16:04:00 +01:00
|
|
|
|
|
|
|
/**
|
2018-04-17 13:53:29 +02:00
|
|
|
* Get paidByClient
|
|
|
|
*
|
|
|
|
* @return string
|
2018-03-15 16:04:00 +01:00
|
|
|
*/
|
2018-04-17 13:53:29 +02:00
|
|
|
public function getPaidByClient() {
|
2023-06-28 16:16:11 +02:00
|
|
|
return $this->paidByClient;
|
|
|
|
}
|
2018-03-15 16:04:00 +01:00
|
|
|
|
|
|
|
/**
|
2018-04-17 13:53:29 +02:00
|
|
|
* Add productsSold
|
|
|
|
*
|
2023-06-20 19:14:19 +02:00
|
|
|
* @param \App\Entity\ProductSold $productsSold
|
2018-04-17 13:53:29 +02:00
|
|
|
*
|
|
|
|
* @return SellRecord
|
2018-03-15 16:04:00 +01:00
|
|
|
*/
|
2023-06-20 19:14:19 +02:00
|
|
|
public function addProductsSold( \App\Entity\ProductSold $productsSold ) {
|
2023-06-28 16:16:11 +02:00
|
|
|
$this->productsSold[] = $productsSold;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
2018-03-15 16:04:00 +01:00
|
|
|
|
|
|
|
/**
|
2018-04-17 13:53:29 +02:00
|
|
|
* Remove productsSold
|
|
|
|
*
|
2023-06-20 19:14:19 +02:00
|
|
|
* @param \App\Entity\ProductSold $productsSold
|
2018-03-15 16:04:00 +01:00
|
|
|
*/
|
2023-06-20 19:14:19 +02:00
|
|
|
public function removeProductsSold( \App\Entity\ProductSold $productsSold ) {
|
2023-06-28 16:16:11 +02:00
|
|
|
$this->productsSold->removeElement( $productsSold );
|
|
|
|
}
|
2018-03-15 16:04:00 +01:00
|
|
|
|
|
|
|
/**
|
2018-04-17 13:53:29 +02:00
|
|
|
* Get productsSold
|
|
|
|
*
|
|
|
|
* @return \Doctrine\Common\Collections\Collection
|
2018-03-15 16:04:00 +01:00
|
|
|
*/
|
2018-04-17 13:53:29 +02:00
|
|
|
public function getProductsSold() {
|
2023-06-28 16:16:11 +02:00
|
|
|
return $this->productsSold;
|
|
|
|
}
|
2018-03-15 16:04:00 +01:00
|
|
|
|
|
|
|
/**
|
2018-04-17 13:53:29 +02:00
|
|
|
* Set festival
|
|
|
|
*
|
2023-06-20 19:14:19 +02:00
|
|
|
* @param \App\Entity\Festival $festival
|
2018-04-17 13:53:29 +02:00
|
|
|
*
|
|
|
|
* @return SellRecord
|
2018-03-15 16:04:00 +01:00
|
|
|
*/
|
2023-06-20 19:14:19 +02:00
|
|
|
public function setFestival( \App\Entity\Festival $festival = null ) {
|
2023-06-28 16:16:11 +02:00
|
|
|
$this->festival = $festival;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
2018-03-15 16:04:00 +01:00
|
|
|
|
2018-04-17 12:10:21 +02:00
|
|
|
/**
|
2018-04-17 13:53:29 +02:00
|
|
|
* Get festival
|
|
|
|
*
|
2023-06-20 19:14:19 +02:00
|
|
|
* @return \App\Entity\Festival
|
2018-04-17 12:10:21 +02:00
|
|
|
*/
|
2018-04-17 13:53:29 +02:00
|
|
|
public function getFestival() {
|
2023-06-28 16:16:11 +02:00
|
|
|
return $this->festival;
|
|
|
|
}
|
2018-04-17 12:10:21 +02:00
|
|
|
|
|
|
|
/**
|
2018-04-17 13:53:29 +02:00
|
|
|
* Set user
|
2018-04-17 12:10:21 +02:00
|
|
|
*
|
2023-06-20 19:14:19 +02:00
|
|
|
* @param \App\Entity\User $user
|
2018-04-17 12:10:21 +02:00
|
|
|
*
|
|
|
|
* @return SellRecord
|
|
|
|
*/
|
2023-06-20 19:14:19 +02:00
|
|
|
public function setUser( \App\Entity\User $user = null ) {
|
2023-06-28 16:16:11 +02:00
|
|
|
$this->user = $user;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
2018-04-17 12:10:21 +02:00
|
|
|
|
|
|
|
/**
|
2018-04-17 13:53:29 +02:00
|
|
|
* Get user
|
2018-04-17 12:10:21 +02:00
|
|
|
*
|
2023-06-20 19:14:19 +02:00
|
|
|
* @return \App\Entity\User
|
2018-04-17 12:10:21 +02:00
|
|
|
*/
|
2018-04-17 13:53:29 +02:00
|
|
|
public function getUser() {
|
2023-06-28 16:16:11 +02:00
|
|
|
return $this->user;
|
|
|
|
}
|
2018-04-19 11:26:44 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set gender.
|
|
|
|
*
|
|
|
|
* @param string|null $gender
|
|
|
|
*
|
|
|
|
* @return SellRecord
|
|
|
|
*/
|
|
|
|
public function setGender($gender = null)
|
|
|
|
{
|
|
|
|
$this->gender = $gender;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get gender.
|
|
|
|
*
|
|
|
|
* @return string|null
|
|
|
|
*/
|
|
|
|
public function getGender()
|
|
|
|
{
|
|
|
|
return $this->gender;
|
|
|
|
}
|
2023-06-28 16:16:11 +02:00
|
|
|
|
|
|
|
public function getAdmin(): ?Admin
|
|
|
|
{
|
|
|
|
return $this->admin;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setAdmin(?Admin $admin): static
|
|
|
|
{
|
|
|
|
$this->admin = $admin;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
2018-03-15 16:04:00 +01:00
|
|
|
}
|