Rajout de doctrine/orm
[zf2.biz/application_blanche.git] / vendor / doctrine / orm / tests / Doctrine / Tests / Models / Quote / Address.php
diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Quote/Address.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/Quote/Address.php
new file mode 100644 (file)
index 0000000..58e303f
--- /dev/null
@@ -0,0 +1,54 @@
+<?php
+
+namespace Doctrine\Tests\Models\Quote;
+
+/**
+ * @Entity
+ * @Table(name="`quote-address`")
+ */
+class Address
+{
+
+    /**
+     * @Id
+     * @GeneratedValue
+     * @Column(type="integer", name="`address-id`")
+     */
+    public $id;
+
+    /**
+     * @Column(name="`address-zip`")
+     */
+    public $zip;
+
+    /**
+     * @OneToOne(targetEntity="User", inversedBy="address")
+     * @JoinColumn(name="`user-id`", referencedColumnName="`user-id`")
+     */
+    public $user;
+
+
+    public function setUser(User $user) {
+        if ($this->user !== $user) {
+            $this->user = $user;
+            $user->setAddress($this);
+        }
+    }
+
+
+    public function getId()
+    {
+        return $this->id;
+    }
+
+    public function getZip()
+    {
+        return $this->zip;
+    }
+
+    public function getUser()
+    {
+        return $this->user;
+    }
+
+}
\ No newline at end of file