CmsAddress.php 1.21 KB
Newer Older
1 2 3 4 5
<?php

namespace Doctrine\Tests\Models\CMS;

/**
6
 * CmsAddress
7
 *
8
 * @author Roman S. Borschel
9 10
 * @Entity
 * @Table(name="cms_addresses")
11 12 13 14
 */
class CmsAddress
{
    /**
15 16
     * @Column(type="integer")
     * @Id
17
     * @GeneratedValue(strategy="AUTO")
18 19
     */
    public $id;
20

21
    /**
22
     * @Column(type="string", length=50)
23 24
     */
    public $country;
25

26
    /**
27
     * @Column(type="string", length=50)
28 29
     */
    public $zip;
30

31
    /**
32
     * @Column(type="string", length=50)
33 34
     */
    public $city;
35

36 37 38 39 40
    /**
     * Testfield for Schema Updating Tests.
     */
    public $street;

41
    /**
42
     * @OneToOne(targetEntity="CmsUser")
43
//     * @JoinColumn(name="user_id", referencedColumnName="id")
44 45
     */
    public $user;
46 47 48 49

    public function getId() {
        return $this->id;
    }
50 51 52 53
    
    public function getUser() {
        return $this->user;
    }
54 55 56 57 58 59 60 61 62 63 64 65

    public function getCountry() {
        return $this->country;
    }

    public function getZipCode() {
        return $this->zip;
    }

    public function getCity() {
        return $this->city;
    }
66 67 68 69 70 71 72
    
    public function setUser(CmsUser $user) {
        if ($this->user !== $user) {
            $this->user = $user;
            $user->setAddress($this);
        }
    }
73
}