caisse-bliss/nope/Entity/ProductSold.php

185 lines
3.1 KiB
PHP
Raw Normal View History

2018-04-05 15:05:04 +02:00
<?php
2023-06-20 19:14:19 +02:00
namespace App\Entity;
2018-04-05 15:05:04 +02:00
2023-06-20 19:14:19 +02:00
use App\Traits\Commentable;
use App\Traits\Sellable;
2018-04-05 15:05:04 +02:00
use Doctrine\ORM\Mapping as ORM;
/**
2023-06-20 19:14:19 +02:00
* @ORM\Entity(repositoryClass="App\Repository\ProductRepository")
2018-04-05 15:05:04 +02:00
*/
2018-04-17 13:53:29 +02:00
class ProductSold {
2018-04-17 12:10:21 +02:00
/**
2018-04-17 13:53:29 +02:00
* @ORM\Column(name="id", type="integer")
2018-04-17 12:10:21 +02:00
* @ORM\Id
2018-04-17 13:53:29 +02:00
* @ORM\GeneratedValue(strategy="AUTO")
2018-04-17 12:10:21 +02:00
*/
private $id;
2018-04-17 13:53:29 +02:00
/**
* @ORM\Column(type="string", length=100)
*/
private $name;
2018-04-05 15:05:04 +02:00
/**
2018-04-17 13:53:29 +02:00
* @ORM\Column(type="string", length=256)
2018-04-05 15:05:04 +02:00
*/
2018-04-17 13:53:29 +02:00
private $image;
2018-04-05 15:05:04 +02:00
2018-04-05 16:40:40 +02:00
/**
2023-06-20 19:14:19 +02:00
* @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="productsSold")
2018-04-05 16:40:40 +02:00
*/
private $user;
2018-04-10 10:16:23 +02:00
2018-04-17 13:53:29 +02:00
/**
* the stack of products for one client at one time
* @ORM\ManyToOne(targetEntity="SellRecord", inversedBy="productsSold")
*/
public $sellRecords;
2018-04-17 12:10:21 +02:00
2018-04-10 10:16:23 +02:00
/**
* references the product from whom this line is inspired
2023-06-20 19:14:19 +02:00
* @ORM\ManyToOne(targetEntity="App\Entity\Product", inversedBy="productsSold")
2018-04-10 10:16:23 +02:00
*/
private $product;
2018-04-17 13:53:29 +02:00
2023-06-28 16:16:11 +02:00
#[ORM\ManyToOne(inversedBy: 'productSold')]
private ?Admin $admin = null;
2018-04-17 13:53:29 +02:00
use Sellable;
use Commentable;
2018-04-10 10:16:23 +02:00
/**
2018-04-17 13:53:29 +02:00
* Set sellRecords.
*
2023-06-20 19:14:19 +02:00
* @param \App\Entity\SellRecord|null $sellRecords
2018-04-17 13:53:29 +02:00
*
* @return ProductSold
2018-04-10 10:16:23 +02:00
*/
2023-06-20 19:14:19 +02:00
public function setSellRecords( \App\Entity\SellRecord $sellRecords = null ) {
2023-06-28 16:16:11 +02:00
$this->sellRecords = $sellRecords;
return $this;
}
2018-04-10 10:16:23 +02:00
/**
2018-04-17 13:53:29 +02:00
* Get sellRecords.
*
2023-06-20 19:14:19 +02:00
* @return \App\Entity\SellRecord|null
2018-04-10 10:16:23 +02:00
*/
2018-04-17 13:53:29 +02:00
public function getSellRecords() {
2023-06-28 16:16:11 +02:00
return $this->sellRecords;
}
2018-04-10 10:16:23 +02:00
/**
2018-04-17 13:53:29 +02:00
* Set product.
*
2023-06-20 19:14:19 +02:00
* @param \App\Entity\Product|null $product
2018-04-17 13:53:29 +02:00
*
* @return ProductSold
2018-04-10 10:16:23 +02:00
*/
2023-06-20 19:14:19 +02:00
public function setProduct( \App\Entity\Product $product = null ) {
2023-06-28 16:16:11 +02:00
$this->product = $product;
return $this;
}
2018-04-10 10:16:23 +02:00
/**
2018-04-17 13:53:29 +02:00
* Get product.
*
2023-06-20 19:14:19 +02:00
* @return \App\Entity\Product|null
2018-04-10 10:16:23 +02:00
*/
2018-04-17 13:53:29 +02:00
public function getProduct() {
2023-06-28 16:16:11 +02:00
return $this->product;
}
2018-04-10 10:16:23 +02:00
/**
2018-04-17 13:53:29 +02:00
* Get id.
*
* @return int
2018-04-10 10:16:23 +02:00
*/
2018-04-17 13:53:29 +02:00
public function getId() {
2023-06-28 16:16:11 +02:00
return $this->id;
}
2018-04-10 10:16:23 +02:00
/**
2018-04-17 13:53:29 +02:00
* Set name.
*
* @param string $name
*
* @return ProductSold
2018-04-10 10:16:23 +02:00
*/
2018-04-17 13:53:29 +02:00
public function setName( $name ) {
2023-06-28 16:16:11 +02:00
$this->name = $name;
return $this;
}
2018-04-10 10:16:23 +02:00
/**
2018-04-17 13:53:29 +02:00
* Get name.
*
* @return string
2018-04-10 10:16:23 +02:00
*/
2018-04-17 13:53:29 +02:00
public function getName() {
2023-06-28 16:16:11 +02:00
return $this->name;
}
2018-04-10 10:16:23 +02:00
/**
2018-04-17 13:53:29 +02:00
* Set image.
2018-04-17 12:10:21 +02:00
*
2018-04-17 13:53:29 +02:00
* @param string $image
2018-04-17 12:10:21 +02:00
*
* @return ProductSold
2018-04-10 10:16:23 +02:00
*/
2018-04-17 13:53:29 +02:00
public function setImage( $image ) {
2023-06-28 16:16:11 +02:00
$this->image = $image;
return $this;
}
2018-04-10 10:16:23 +02:00
/**
2018-04-17 13:53:29 +02:00
* Get image.
2018-04-17 12:10:21 +02:00
*
2018-04-17 13:53:29 +02:00
* @return string
2018-04-10 10:16:23 +02:00
*/
2018-04-17 13:53:29 +02:00
public function getImage() {
2023-06-28 16:16:11 +02:00
return $this->image;
}
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|null $user
2018-04-17 12:10:21 +02:00
*
* @return ProductSold
*/
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-10 10:16:23 +02:00
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|null
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;
}
public function getAdmin(): ?Admin
{
return $this->admin;
}
public function setAdmin(?Admin $admin): static
{
$this->admin = $admin;
return $this;
}
2018-04-05 15:05:04 +02:00
}