Rajout de doctrine/orm
[zf2.biz/application_blanche.git] / vendor / doctrine / orm / tools / sandbox / Entities / User.php
diff --git a/vendor/doctrine/orm/tools/sandbox/Entities/User.php b/vendor/doctrine/orm/tools/sandbox/Entities/User.php
new file mode 100644 (file)
index 0000000..cd18421
--- /dev/null
@@ -0,0 +1,48 @@
+<?php
+
+namespace Entities;
+
+/** @Entity @Table(name="users") */
+class User
+{
+    /**
+     * @Id @Column(type="integer")
+     * @GeneratedValue(strategy="AUTO")
+     */
+    private $id;
+    /** @Column(type="string", length=50) */
+    private $name;
+    /**
+     * @OneToOne(targetEntity="Address", inversedBy="user")
+     * @JoinColumn(name="address_id", referencedColumnName="id")
+     */
+    private $address;
+
+    public function getId()
+    {
+        return $this->id;
+    }
+
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    public function setName($name)
+    {
+        $this->name = $name;
+    }
+
+    public function getAddress()
+    {
+        return $this->address;
+    }
+
+    public function setAddress(Address $address)
+    {
+        if ($this->address !== $address) {
+            $this->address = $address;
+            $address->setUser($this);
+        }
+    }
+}
\ No newline at end of file