Select Git revision
Source.class.inc
Source.class.inc 2.56 KiB
<?php
require_once 'Vmap4MapServer.class.inc';
require_once dirname($_SERVER['SCRIPT_FILENAME']) . '/class/vitis_lib/Connection.class.inc';
/**
* \file Source.class.inc
* \class Source
*
* \author Armand Bahi <armand.bahi@veremes.com>.
*
* \brief This file contains the Source php class
*
* This class defines operation for one source
*
*/
class Source extends Vmap4MapServer {
public $oError;
/**
* construct
* @param type $aPath url of the request
* @param type $aValues parameters of the request
* @param type $properties properties
* @param type $bShortcut false to reinit variables
* @param type $oConnection connection object
*/
function __construct($aPath, $aValues, $properties, $bShortcut = false, $oConnection = false) {
parent::__construct($aPath, $aValues, $properties, $bShortcut, $oConnection);
$this->aSelectedFields = Array("source_id", "name", "definition");
}
/**
* @SWG\Get(path="/sources/{source_id}",
* tags={"Sources"},
* summary="Get source",
* description="Request to get source by id",
* operationId="GET",
* produces={"application/xml", "application/json", "application/x-vm-json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="user token",
* required=true,
* type="string"
* ),
* @SWG\Parameter(
* name="source_id",
* in="path",
* description="source id",
* required=true,
* type="integer",
* format = "int32"
* ),
* @SWG\Response(
* response=200,
* description="Poprerties Response",
* @SWG\Schema(ref="#/definitions/sources")
* )
* )
*/
/**
* get informations about source
*/
function GET() {
require $this->sRessourcesFile;
$this->aFields = $this->getFields($this->aProperties['schema_vm4ms'], 'source', 'source_id');
}