caisse-bliss/src/Entity/ProductSold.php

170 lines
2.7 KiB
PHP
Raw Normal View History

2018-04-05 15:05:04 +02:00
<?php
namespace AppBundle\Entity;
2018-04-17 13:53:29 +02:00
use AppBundle\Traits\Commentable;
use AppBundle\Traits\Sellable;
2018-04-05 15:05:04 +02:00
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="AppBundle\Repository\ProductRepository")
*/
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
/**
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\User", inversedBy="productsSold")
*/
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
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\Product", inversedBy="productsSold")
*/
private $product;
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.
*
* @param \AppBundle\Entity\SellRecord|null $sellRecords
*
* @return ProductSold
2018-04-10 10:16:23 +02:00
*/
2018-04-17 13:53:29 +02:00
public function setSellRecords( \AppBundle\Entity\SellRecord $sellRecords = null ) {
$this->sellRecords = $sellRecords;
return $this;
}
2018-04-10 10:16:23 +02:00
/**
2018-04-17 13:53:29 +02:00
* Get sellRecords.
*
* @return \AppBundle\Entity\SellRecord|null
2018-04-10 10:16:23 +02:00
*/
2018-04-17 13:53:29 +02:00
public function getSellRecords() {
return $this->sellRecords;
2018-04-10 10:16:23 +02:00
}
/**
2018-04-17 13:53:29 +02:00
* Set product.
*
* @param \AppBundle\Entity\Product|null $product
*
* @return ProductSold
2018-04-10 10:16:23 +02:00
*/
2018-04-17 13:53:29 +02:00
public function setProduct( \AppBundle\Entity\Product $product = null ) {
$this->product = $product;
return $this;
2018-04-10 10:16:23 +02:00
}
/**
2018-04-17 13:53:29 +02:00
* Get product.
*
* @return \AppBundle\Entity\Product|null
2018-04-10 10:16:23 +02:00
*/
2018-04-17 13:53:29 +02:00
public function getProduct() {
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() {
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 ) {
$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() {
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 ) {
$this->image = $image;
2018-04-17 12:10:21 +02:00
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() {
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
*
2018-04-17 13:53:29 +02:00
* @param \AppBundle\Entity\User|null $user
2018-04-17 12:10:21 +02:00
*
* @return ProductSold
*/
2018-04-17 13:53:29 +02:00
public function setUser( \AppBundle\Entity\User $user = null ) {
$this->user = $user;
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
/**
2018-04-17 13:53:29 +02:00
* Get user.
2018-04-17 12:10:21 +02:00
*
2018-04-17 13:53:29 +02:00
* @return \AppBundle\Entity\User|null
2018-04-17 12:10:21 +02:00
*/
2018-04-17 13:53:29 +02:00
public function getUser() {
return $this->user;
2018-04-17 12:10:21 +02:00
}
2018-04-05 15:05:04 +02:00
}