1
0
mirror of synced 2024-12-05 03:06:05 +03:00

[2.0] Fixing coding standards of sandbox entities

This commit is contained in:
jwage 2010-03-17 14:09:17 +00:00
parent 90d2883937
commit 9b5968957d
2 changed files with 25 additions and 14 deletions

View File

@ -3,7 +3,8 @@
namespace Entities;
/** @Entity @Table(name="addresses") */
class Address {
class Address
{
/**
* @Id @Column(type="integer")
* @GeneratedValue(strategy="AUTO")
@ -14,27 +15,31 @@ class Address {
/** @OneToOne(targetEntity="User", mappedBy="address") */
private $user;
public function getId() {
public function getId()
{
return $this->id;
}
public function getStreet() {
public function getStreet()
{
return $this->street;
}
public function setStreet($street) {
public function setStreet($street)
{
$this->street = $street;
}
public function getUser() {
public function getUser()
{
return $this->user;
}
public function setUser(User $user) {
public function setUser(User $user)
{
if ($this->user !== $user) {
$this->user = $user;
$user->setAddress($this);
}
}
}
}

View File

@ -3,7 +3,8 @@
namespace Entities;
/** @Entity @Table(name="users") */
class User {
class User
{
/**
* @Id @Column(type="integer")
* @GeneratedValue(strategy="AUTO")
@ -17,23 +18,28 @@ class User {
*/
private $address;
public function getId() {
public function getId()
{
return $this->id;
}
public function getName() {
public function getName()
{
return $this->name;
}
public function setName($name) {
public function setName($name)
{
$this->name = $name;
}
public function getAddress() {
public function getAddress()
{
return $this->address;
}
public function setAddress(Address $address) {
public function setAddress(Address $address)
{
if ($this->address !== $address) {
$this->address = $address;
$address->setUser($this);