class DataSource

This class allows the storage and retrieval of the attributes of a data source.

A data source is where a simulator retrieves reference data to perform the simulation.

A data source is an internal database, an external database, or a web service that can be accessed using a parametrized uri.

The data sources définition are stored in src/EUREKA/G6KBundle/Resources/data/DataSources.xml

Properties

private Simulator $simulator
private int $id
private string $name
private string $type
private string $uri
private string $method
private int $database
private string $description
private array $tables
private array $namespaces

Methods

void
__construct(Simulator $simulator, int $id, string $name, string $type)

Constructor of class DataSource

getSimulator()

Returns the Simulator object that uses this data source

int
getId()

Returns the ID of this data source.

void
setId(int $id)

Sets the ID of this data source.

string
getName()

Returns the name of this data source.

void
setName(string $name)

Sets the name of this data source.

string
getType()

Returns the type of this data source : uri, database orinternal

void
setType(string $type)

Sets the type of this data source : uri, database or internal

string
getUri()

Returns the uri of this data source in case of web service.

void
setUri(string $uri)

Sets the uri of this data source in case of web service.

string
getMethod()

Returns the HTTP access method of this data source : GET or POST

void
setMethod(string $method)

Sets the HTTP access method of this data source: GET or POST

int
getDatabase()

Returns the ID of the database if the type of this data source is internal or database.

void
setDatabase(int $database)

Sets the ID of the database if the type of this data source is internal or database.

string
getDescription()

Returns the description of this data source.

void
setDescription(string $description)

Sets the description of this data source.

array
getNamespaces()

Returns the associative array of namespaces of this data source.

void
setNamespaces(array $namespaces)

Sets the associative array of namespaces of this data source.

void
addNamespace(string $prefix, string $uri)

Adds a namespace to the associative array of namespaces of this data source.

array
getTables()

Returns the list of tables in the database of this data source.

void
setTables(array $tables)

Sets the list of tables in the database of this data source.

void
addTable(Table $table)

Adds a table to the list of tables in the database of this data source.

Details

at line 136
void __construct(Simulator $simulator, int $id, string $name, string $type)

Constructor of class DataSource

Parameters

Simulator $simulator The Simulator object that uses this data source
int $id The ID of this data source
string $name The name of this data source
string $type The type of this data source : uri, internal or database

Return Value

void

at line 150
Simulator getSimulator()

Returns the Simulator object that uses this data source

Return Value

Simulator The Simulator Object

at line 161
int getId()

Returns the ID of this data source.

Return Value

int The ID of this data source

at line 173
void setId(int $id)

Sets the ID of this data source.

Parameters

int $id The ID of this data source

Return Value

void

at line 184
string getName()

Returns the name of this data source.

Return Value

string The name of this data source

at line 196
void setName(string $name)

Sets the name of this data source.

Parameters

string $name The name of this data source

Return Value

void

at line 207
string getType()

Returns the type of this data source : uri, database orinternal

Return Value

string The type of this data source

at line 219
void setType(string $type)

Sets the type of this data source : uri, database or internal

Parameters

string $type The type of this data source

Return Value

void

at line 230
string getUri()

Returns the uri of this data source in case of web service.

Return Value

string The uri of this data source

at line 242
void setUri(string $uri)

Sets the uri of this data source in case of web service.

Parameters

string $uri The uri of this data source

Return Value

void

at line 253
string getMethod()

Returns the HTTP access method of this data source : GET or POST

Return Value

string The HTTP access method of this data source

at line 265
void setMethod(string $method)

Sets the HTTP access method of this data source: GET or POST

Parameters

string $method The HTTP access method of this data source

Return Value

void

at line 278
int getDatabase()

Returns the ID of the database if the type of this data source is internal or database.

Return Value

int The ID of the database

at line 290
void setDatabase(int $database)

Sets the ID of the database if the type of this data source is internal or database.

Parameters

int $database The ID of the database

Return Value

void

at line 301
string getDescription()

Returns the description of this data source.

Return Value

string The description of this data source

at line 313
void setDescription(string $description)

Sets the description of this data source.

Parameters

string $description The description of this data source

Return Value

void

at line 327
array getNamespaces()

Returns the associative array of namespaces of this data source.

The keys in this array are the namespace prefixes. The values in this array are the namespace uris.

Return Value

array The associative array of namespaces

at line 342
void setNamespaces(array $namespaces)

Sets the associative array of namespaces of this data source.

The keys in this array are the namespace prefixes. The values in this array are the namespace uris.

Parameters

array $namespaces The associative array of namespaces

Return Value

void

at line 355
void addNamespace(string $prefix, string $uri)

Adds a namespace to the associative array of namespaces of this data source.

Parameters

string $prefix The namespace prefix
string $uri The namespace uri

Return Value

void

at line 366
array getTables()

Returns the list of tables in the database of this data source.

Return Value

array The list of tables

at line 378
void setTables(array $tables)

Sets the list of tables in the database of this data source.

Parameters

array $tables The list of tables

Return Value

void

at line 390
void addTable(Table $table)

Adds a table to the list of tables in the database of this data source.

Parameters

Table $table The table to add

Return Value

void