1
0
mirror of synced 2024-12-14 23:26:04 +03:00
doctrine2/tests/Doctrine/Tests/Models/ECommerce/ECommerceFeature.php

60 lines
1.2 KiB
PHP
Raw Normal View History

<?php
namespace Doctrine\Tests\Models\ECommerce;
/**
* Describes a product feature.
*
* @author Giorgio Sironi
* @Entity
* @Table(name="ecommerce_features")
*/
class ECommerceFeature
{
/**
* @Column(type="integer")
* @Id
2010-04-10 02:00:36 +04:00
* @GeneratedValue
*/
private $id;
/**
2010-04-10 02:00:36 +04:00
* @Column(length=50)
*/
private $description;
/**
2010-04-10 02:00:36 +04:00
* @ManyToOne(targetEntity="ECommerceProduct", inversedBy="features")
* @JoinColumn(name="product_id", referencedColumnName="id")
*/
private $product;
public function getId() {
return $this->id;
}
public function getDescription() {
return $this->description;
}
public function setDescription($description) {
$this->description = $description;
}
public function setProduct(ECommerceProduct $product) {
$this->product = $product;
}
public function removeProduct() {
if ($this->product !== null) {
$product = $this->product;
$this->product = null;
$product->removeFeature($this);
}
}
public function getProduct() {
return $this->product;
}
}