[2.0] Fixing coding standards of sandbox entities
This commit is contained in:
parent
90d2883937
commit
9b5968957d
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user