<?php
namespace Bravo3\Orm\Tests\Entities\OneToOne;

use Bravo3\Orm\Annotations as Orm;

/**
 * @Orm\Entity(table="users", indices={
 *      @Orm\Index(name="slug", columns={"id", "address"})
 * })
 */
class User
{
    /**
     * @var int
     * @Orm\Id
     * @Orm\Column(type="int")
     */
    protected $id;

    /**
     * @var string
     * @Orm\Column(type="string")
     */
    protected $name;

    /**
     * @var Address
     * @Orm\OneToOne(target="Bravo3\Orm\Tests\Entities\OneToOne\Address", inversed_by="user")
     */
    protected $address;

    /**
     * Get Id
     *
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set Id
     *
     * @param int $id
     * @return $this
     */
    public function setId($id)
    {
        $this->id = $id;
        return $this;
    }

    /**
     * Get Name
     *
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Set Name
     *
     * @param string $name
     * @return $this
     */
    public function setName($name)
    {
        $this->name = $name;
        return $this;
    }

    /**
     * Get Address
     *
     * @return Address
     */
    public function getAddress()
    {
        return $this->address;
    }

    /**
     * Set Address
     *
     * @param Address $address
     * @return $this
     */
    public function setAddress(Address $address = null)
    {
        $this->address = $address;
        return $this;
    }
}
