<?php

if ( ! defined( 'ABSPATH' ) ) exit;

require_once "DigitalSignage4_Entity.php";

class DigitalSignage4_ForfaitEntity extends DigitalSignage4_Entity
{
    private $id = null;
    private $token = null;
    private $domain = null;
    private $date_debut = null;
    private $date_fin = null;
    private $credit = null;
    private $credit_used_period = null;
    private $credit_used_total = null;
    private $compte = null;
    private $trial = null;
    private $canDownload = null;
    private $active_videos = null;


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

    /**
     * @param null $id
     *
     * @return DigitalSignage4_ForfaitEntity
     */
    public function setId($id)
    {
        $this->id = $id;

        return $this;
    }

    /**
     * @return null
     */
    public function getCanDownload()
    {
        return $this->canDownload;
    }

    /**
     * @param null $canDownload
     *
     * @return boolean
     */
    public function setCanDownload($canDownload)
    {
        $this->canDownload = $canDownload;

        return $this;
    }

    /**
     * @return null
     */
    public function getActiveVideos()
    {
        return $this->active_videos;
    }

    /**
     * @param null $canDownload
     *
     * @return boolean
     */
    public function setActiveVideos($active_videos)
    {
        $this->active_videos = $active_videos;

        return $this;
    }

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

    /**
     * @param null $token
     *
     * @return DigitalSignage4_ForfaitEntity
     */
    public function setToken($token)
    {
        $this->token = $token;

        return $this;
    }

    /**
     * @return null
     */
    public function getDomain()
    {
        return $this->domain;
    }

    /**
     * @param null $domain
     *
     * @return DigitalSignage4_ForfaitEntity
     */
    public function setDomain($domain)
    {
        $this->domain = $domain;

        return $this;
    }

    /**
     * @return null
     */
    public function getDateDebut()
    {
        return $this->date_debut;
    }

    /**
     * @param null $date_debut
     *
     * @return DigitalSignage4_ForfaitEntity
     */
    public function setDateDebut($date_debut)
    {
        $this->date_debut = $date_debut;

        return $this;
    }

    public function isExpired()
    {
        return (strtotime($this->date_fin) - time() < 0);
    }

    /**
     * @return null
     */
    public function getDateFin()
    {
        return $this->date_fin;
    }

    /**
     * @param null $date_fin
     *
     * @return DigitalSignage4_ForfaitEntity
     */
    public function setDateFin($date_fin)
    {
        $this->date_fin = $date_fin;

        return $this;
    }

    /**
     * @return null
     */
    public function getCredit()
    {
        return $this->credit;
    }

    /**
     * @param null $credit
     *
     * @return DigitalSignage4_ForfaitEntity
     */
    public function setCredit($credit)
    {
        $this->credit = $credit;

        return $this;
    }

    /**
     * @return null
     */
    public function getCreditUsedPeriod()
    {
        return $this->credit_used_period;
    }

    /**
     * @param null $credit_used_period
     *
     * @return DigitalSignage4_ForfaitEntity
     */
    public function setCreditUsedPeriod($credit_used_period)
    {
        $this->credit_used_period = $credit_used_period;

        return $this;
    }

    /**
     * @return null
     */
    public function getCreditUsedTotal()
    {
        return $this->credit_used_total;
    }

    /**
     * @param null $credit_used_total
     *
     * @return DigitalSignage4_ForfaitEntity
     */
    public function setCreditUsedTotal($credit_used_total)
    {
        $this->credit_used_total = $credit_used_total;

        return $this;
    }

    /**
     * @return null|DigitalSignage4_CompteEntity
     */
    public function getCompte()
    {
        return $this->compte;
    }

    /**
     * @param DigitalSignage4_CompteEntity $compte
     *
     * @return DigitalSignage4_ForfaitEntity
     */
    public function setCompte($compte)
    {
        $this->compte = $compte;

        return $this;
    }

    /**
     * @return null
     */
    public function getTrial()
    {
        return $this->trial;
    }

    /**
     * @param null $trial
     */
    public function setTrial($trial)
    {
        $this->trial = filter_var($trial, FILTER_VALIDATE_BOOLEAN);
    }
}
