1
0
mirror of synced 2024-12-13 22:56:04 +03:00
doctrine2/tests/Doctrine/Tests/Models/ECommerce/ECommerceCustomer.php
2009-07-01 09:18:08 +00:00

44 lines
792 B
PHP

<?php
namespace Doctrine\Tests\Models\ECommerce;
/**
* ECommerceCustomer
* Represents a registered user of a shopping application.
*
* @author Giorgio Sironi
* @Entity
* @Table(name="ecommerce_customers")
*/
class ECommerceCustomer
{
/**
* @Column(type="integer")
* @Id
* @GeneratedValue(strategy="AUTO")
*/
public $id;
/**
* @Column(type="string", length=50)
*/
public $name;
/**
* @OneToOne(targetEntity="ECommerceCart", mappedBy="customer", cascade={"save"})
*/
public $cart;
public function setCart(ECommerceCart $cart)
{
$this->cart = $cart;
$cart->customer = $this;
}
public function removeCart()
{
$this->cart->customer = null;
$this->cart = null;
}
}