<?php
namespace app\modules\hub\controllers\api\endpoints\session;

use yii\beutils\components\rest\Endpoint;
use app\modules\hub\essentials\Session;
use app\modules\hub\models\api\Session as Model;

class EndpointProgressV1_0 extends Endpoint{

    private $session = null;
    private $model = null;

    public function __construct(){
        $this->session = new Session();
        $this->model = new Model('peers'); 
    }

    protected function get(){

        // Set model data
        $this->model->attributes = \Yii::$app->rest->request->data;
        
        // Validate model
        if (!($this->model->validate())){
            \Yii::$app->rest->BAD_REQUEST();
        }

        // Get session peers
    }

    protected function post(){
        \Yii::$app->rest->METHOD_NOT_ALLOWED();
    }

    protected function put(){
        \Yii::$app->rest->METHOD_NOT_ALLOWED();
    }

    protected function delete(){
        \Yii::$app->rest->METHOD_NOT_ALLOWED();
    }
}