1
0
mirror of synced 2024-12-15 15:46:02 +03:00
doctrine2/tests/Doctrine/Tests/Models/CMS/CmsAddress.php

71 lines
1.1 KiB
PHP
Raw Normal View History

<?php
namespace Doctrine\Tests\Models\CMS;
/**
* CmsAddress
*
* @author Roman S. Borschel
* @Entity
* @Table(name="cms_addresses")
*/
class CmsAddress
{
/**
* @Column(type="integer")
2010-04-10 02:00:36 +04:00
* @Id @GeneratedValue
*/
public $id;
/**
2010-04-10 02:00:36 +04:00
* @Column(length=50)
*/
public $country;
/**
2010-04-10 02:00:36 +04:00
* @Column(length=50)
*/
public $zip;
/**
2010-04-10 02:00:36 +04:00
* @Column(length=50)
*/
public $city;
/**
* Testfield for Schema Updating Tests.
*/
public $street;
/**
2010-04-10 02:00:36 +04:00
* @OneToOne(targetEntity="CmsUser", inversedBy="address")
*/
public $user;
public function getId() {
return $this->id;
}
public function getUser() {
return $this->user;
}
public function getCountry() {
return $this->country;
}
public function getZipCode() {
return $this->zip;
}
public function getCity() {
return $this->city;
}
public function setUser(CmsUser $user) {
if ($this->user !== $user) {
$this->user = $user;
$user->setAddress($this);
}
}
}