2018-04-05 15:05:04 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace AppBundle\Entity;
|
|
|
|
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @ORM\Entity(repositoryClass="AppBundle\Repository\ProductRepository")
|
|
|
|
*/
|
|
|
|
class ProductSold extends Product {
|
2018-04-17 12:10:21 +02:00
|
|
|
/**
|
|
|
|
* @ORM\Id
|
|
|
|
* @ORM\GeneratedValue
|
|
|
|
* @ORM\Column(type="integer")
|
|
|
|
*/
|
|
|
|
private $id;
|
|
|
|
|
2018-04-05 15:05:04 +02:00
|
|
|
|
|
|
|
/**
|
2018-04-10 10:16:23 +02:00
|
|
|
* the stack of products for one client at one time
|
2018-04-05 16:40:40 +02:00
|
|
|
* @ORM\ManyToOne(targetEntity="SellRecord", inversedBy="productsSold")
|
2018-04-05 15:05:04 +02:00
|
|
|
*/
|
2018-04-10 10:16:23 +02:00
|
|
|
public $sellRecords;
|
2018-04-05 15:05:04 +02:00
|
|
|
|
2018-04-05 16:40:40 +02:00
|
|
|
/**
|
2018-04-10 10:16:23 +02:00
|
|
|
* person who recorded the sell
|
2018-04-05 16:40:40 +02:00
|
|
|
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\User", inversedBy="productsSold")
|
|
|
|
*/
|
|
|
|
private $user;
|
2018-04-10 10:16:23 +02:00
|
|
|
|
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
|
|
|
|
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\Product", inversedBy="productsSold")
|
|
|
|
*/
|
|
|
|
private $product;
|
|
|
|
/**
|
|
|
|
* @ORM\ManyToOne(targetEntity="ProductCategory", inversedBy="products")
|
|
|
|
*/
|
|
|
|
private $category;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
2018-04-17 12:10:21 +02:00
|
|
|
public function getId() {
|
|
|
|
return $this->id;
|
2018-04-10 10:16:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2018-04-17 12:10:21 +02:00
|
|
|
* @param mixed $id
|
2018-04-10 10:16:23 +02:00
|
|
|
*/
|
2018-04-17 12:10:21 +02:00
|
|
|
public function setId( $id ) {
|
|
|
|
$this->id = $id;
|
2018-04-10 10:16:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
2018-04-17 12:10:21 +02:00
|
|
|
public function getUser() {
|
|
|
|
return $this->user;
|
2018-04-10 10:16:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2018-04-17 12:10:21 +02:00
|
|
|
* @param mixed $user
|
2018-04-10 10:16:23 +02:00
|
|
|
*/
|
2018-04-17 12:10:21 +02:00
|
|
|
public function setUser( $user ) {
|
|
|
|
$this->user = $user;
|
2018-04-10 10:16:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
2018-04-17 12:10:21 +02:00
|
|
|
public function getCategory() {
|
|
|
|
return $this->category;
|
2018-04-10 10:16:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2018-04-17 12:10:21 +02:00
|
|
|
* @param mixed $category
|
2018-04-10 10:16:23 +02:00
|
|
|
*/
|
2018-04-17 12:10:21 +02:00
|
|
|
public function setCategory( ProductCategory $category ) {
|
|
|
|
$this->category = $category;
|
2018-04-10 10:16:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2018-04-17 12:10:21 +02:00
|
|
|
* Set sellRecords
|
|
|
|
*
|
|
|
|
* @param \AppBundle\Entity\SellRecord $sellRecords
|
|
|
|
*
|
|
|
|
* @return ProductSold
|
2018-04-10 10:16:23 +02:00
|
|
|
*/
|
2018-04-17 12:10:21 +02:00
|
|
|
public function setSellRecords( SellRecord $sellRecords = null ) {
|
|
|
|
$this->sellRecords = $sellRecords;
|
|
|
|
|
|
|
|
return $this;
|
2018-04-10 10:16:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2018-04-17 12:10:21 +02:00
|
|
|
* Get sellRecords
|
|
|
|
*
|
|
|
|
* @return \AppBundle\Entity\SellRecord
|
2018-04-10 10:16:23 +02:00
|
|
|
*/
|
2018-04-17 12:10:21 +02:00
|
|
|
public function getSellRecords() {
|
|
|
|
return $this->sellRecords;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set product
|
|
|
|
*
|
|
|
|
* @param \AppBundle\Entity\Product $product
|
|
|
|
*
|
|
|
|
* @return ProductSold
|
|
|
|
*/
|
|
|
|
public function setProduct( Product $product = null ) {
|
2018-04-10 10:16:23 +02:00
|
|
|
$this->product = $product;
|
2018-04-17 12:10:21 +02:00
|
|
|
|
|
|
|
return $this;
|
2018-04-10 10:16:23 +02:00
|
|
|
}
|
|
|
|
|
2018-04-17 12:10:21 +02:00
|
|
|
/**
|
|
|
|
* Get product
|
|
|
|
*
|
|
|
|
* @return \AppBundle\Entity\Product
|
|
|
|
*/
|
|
|
|
public function getProduct() {
|
|
|
|
return $this->product;
|
|
|
|
}
|
2018-04-05 15:05:04 +02:00
|
|
|
}
|