<?php

namespace RxConnexionBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use RxConnexionBundle\Entity\Base\BaseEntity;
use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToStringTransformer;
use JMS\Serializer\Annotation\Groups;
use JMS\Serializer\Annotation\MaxDepth;

/**
 * @ORM\Entity(repositoryClass="RxConnexionBundle\Repository\RxApiSessionRepository")
 * @ORM\Table(name="rx_api_session")
 */

class RxApiSessionEntity extends BaseEntity
{

    /**
     * @ORM\Column(name="token", type="string")
     */
    protected $token;

    /**
     * @ORM\Column(name="expiry", type="datetime")
     */
    protected $expiry;

    /**
     * @ORM\ManyToOne(targetEntity="RxConnexionBundle\Entity\AccountUserEntity", inversedBy="rxApiSessions")
     * @ORM\JoinColumn(name="account_user_id", referencedColumnName="id")
     */
    protected $accountUser;

    /*--------------------------------------------------------------------------------------------------------*/
    /*					Use Defined Setters and Getters														  */
    /*--------------------------------------------------------------------------------------------------------*/
    /*--------------------------------------------------------------------------------------------------------*/
    /*					Setters and Getters																	  */
    /*--------------------------------------------------------------------------------------------------------*/


    /**
     * Set token
     *
     * @param string $token
     *
     * @return RxApiSessionEntity
     */
    public function setToken($token)
    {
        $this->token = $token;

        return $this;
    }

    /**
     * Get token
     *
     * @return string
     */
    public function getToken()
    {
        return $this->token;
    }

    /**
     * Set expiry
     *
     * @param \DateTime $expiry
     *
     * @return RxApiSessionEntity
     */
    public function setExpiry($expiry)
    {
        $this->expiry = $expiry;

        return $this;
    }

    /**
     * Get expiry
     *
     * @return \DateTime
     */
    public function getExpiry()
    {
        return $this->expiry;
    }

    /**
     * Set accountUser
     *
     * @param \RxConnexionBundle\Entity\AccountUserEntity $accountUser
     *
     * @return RxApiSessionEntity
     */
    public function setAccountUser(\RxConnexionBundle\Entity\AccountUserEntity $accountUser = null)
    {
        $this->accountUser = $accountUser;

        return $this;
    }

    /**
     * Get accountUser
     *
     * @return \RxConnexionBundle\Entity\AccountUserEntity
     */
    public function getAccountUser()
    {
        return $this->accountUser;
    }
}
