90 lines
1.2 KiB
PHP
90 lines
1.2 KiB
PHP
|
<?php
|
||
|
|
||
|
namespace App\Entity;
|
||
|
|
||
|
use Doctrine\ORM\Mapping as ORM;
|
||
|
|
||
|
/**
|
||
|
* @ORM\Entity(repositoryClass="App\Repository\ProductRepository")
|
||
|
*/
|
||
|
class Product {
|
||
|
/**
|
||
|
* @ORM\Id
|
||
|
* @ORM\GeneratedValue
|
||
|
* @ORM\Column(type="integer")
|
||
|
*/
|
||
|
private $id;
|
||
|
|
||
|
/**
|
||
|
* @ORM\Column(type="string", length=100)
|
||
|
*/
|
||
|
private $name;
|
||
|
|
||
|
/**
|
||
|
* @ORM\Column(type="decimal", scale=2, nullable=true)
|
||
|
*/
|
||
|
private $price;
|
||
|
/**
|
||
|
* @ORM\ManyToOne(targetEntity="ProductCategory", mappedBy="products")
|
||
|
*/
|
||
|
private $category;
|
||
|
|
||
|
/**
|
||
|
* @return mixed
|
||
|
*/
|
||
|
public function getId() {
|
||
|
return $this->id;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @param mixed $id
|
||
|
*/
|
||
|
public function setId( $id ) {
|
||
|
$this->id = $id;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @return mixed
|
||
|
*/
|
||
|
public function getName() {
|
||
|
return $this->name;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @param mixed $name
|
||
|
*/
|
||
|
public function setName( $name ) {
|
||
|
$this->name = $name;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @return mixed
|
||
|
*/
|
||
|
public function getPrice() {
|
||
|
return $this->price;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @param mixed $price
|
||
|
*/
|
||
|
public function setPrice( $price ) {
|
||
|
$this->price = $price;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @return mixed
|
||
|
*/
|
||
|
public function getCategory() {
|
||
|
return $this->category;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @param ProductCategory $category
|
||
|
*/
|
||
|
public function setCategory( ProductCategory $category ) {
|
||
|
$this->category = $category;
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|