Source
class Source
This class allows the storage and retrieval of the attributes of a source.
In a Source object, is defined a particular access query to a data source for a simulator.
Properties
private Simulator | $simulator | ||
private int | $id | ||
private string | $label | ||
private string | $datasource | ||
private string | $request | ||
private string | $requestType | ||
private array | $parsed | ||
private string | $returnType | ||
private string | $separator | ||
private string | $delimiter | ||
private string | $returnPath | ||
private array | $parameters |
Methods
Constructor of class Source
Returns the Simulator object that uses this source
Returns the ID of this source.
Sets the ID of this source.
Returns the label of this source.
Sets the label of this source.
Returns the name of the data source accessed by this source
Sets the name of the data source accessed by this source
Returns the SQL Select clause for internal or external database
Sets the SQL Select clause for internal or external database
Returns the type of the request ('simple' or 'complex')
Sets the type of the request ('simple' or 'complex')
Returns the associative array, result of the parsing of the simple SQL Request
Sets the result of the parsing of the simple SQL Request
Returns the type (format) or the result returned by the request
Sets the type (format) or the result returned by the request
Returns the character that separates the fields in a query result in csv format
Sets the character that separates the fields in a query result in csv format
Returns the character that delimits the fields in a query result in csv format
Sets the character that delimits the fields in a query result in csv format
Returns the expression allowing the location of the value looked for in the result returned by the request of this source.
Sets the expression allowing the location of the value looked for in the result returned by the request of this source.
Returns the list of parameters passed to the request of this source.
Sets the list of parameters passed to the request of this source.
Adds a Parameter object to the list of parameters passed to the request of this source.
Removes a Parameter object from the list of parameters passed to the request of this source.
Retrieves a Parameter object by its name in the list of parameters passed to the request of this source.
Details
at line 146
void
__construct(Simulator|null $simulator, int $id, string $datasource, string $returnType)
Constructor of class Source
at line 160
Simulator
getSimulator()
Returns the Simulator object that uses this source
at line 171
int
getId()
Returns the ID of this source.
at line 183
void
setId(int $id)
Sets the ID of this source.
at line 194
string
getLabel()
Returns the label of this source.
at line 206
void
setLabel(string $label)
Sets the label of this source.
at line 217
string
getDatasource()
Returns the name of the data source accessed by this source
at line 229
void
setDatasource(string $datasource)
Sets the name of the data source accessed by this source
at line 240
string
getRequest()
Returns the SQL Select clause for internal or external database
at line 252
void
setRequest(string $request)
Sets the SQL Select clause for internal or external database
at line 265
string
getRequestType()
Returns the type of the request ('simple' or 'complex')
A request is simple if it concerns only one table and does not have a nested subquery, otherwise it is complex
at line 279
void
setRequestType(string $requestType)
Sets the type of the request ('simple' or 'complex')
A request is simple if it concerns only one table and does not have a nested subquery, otherwise it is complex
at line 293
array
getParsed()
Returns the associative array, result of the parsing of the simple SQL Request
The associative array has the following keys : 'select', 'from', 'where', 'conditions', 'orderby', 'limit', 'offset'
at line 308
void
setParsed(array $parsed)
Sets the result of the parsing of the simple SQL Request
Th result of the parsing is an associative array with the following keys : 'select', 'from', 'where', 'conditions', 'orderby', 'limit', 'offset'
at line 328
string
getReturnType()
Returns the type (format) or the result returned by the request
The possible values are:
- json: Javascript Object Notation
- xml: eXtended Markup Language
- html: Hyper Text Markup Language
- csv: Comma Separated Value
- assocArray: Table of key / value pairs.
- singleValue: Scalar value
at line 349
void
setReturnType(string $returnType)
Sets the type (format) or the result returned by the request
The possible values are:
- json: Javascript Object Notation
- xml: eXtended Markup Language
- html: Hyper Text Markup Language
- csv: Comma Separated Value
- assocArray: Table of key / value pairs.
- singleValue: Scalar value
at line 360
mixed
getSeparator()
Returns the character that separates the fields in a query result in csv format
at line 372
void
setSeparator(string $separator)
Sets the character that separates the fields in a query result in csv format
at line 383
string
getDelimiter()
Returns the character that delimits the fields in a query result in csv format
at line 395
void
setDelimiter(string $delimiter)
Sets the character that delimits the fields in a query result in csv format
at line 417
string
getReturnPath()
Returns the expression allowing the location of the value looked for in the result returned by the request of this source.
The form of this expression depends on the format of the result of the query (returnType):
- json: JSONPath or XPath expression
- xml: XPath expression
- html: XPath expression
- csv: line number / column number
- assocArray: line number / column name
- singleValue : N/A
at line 441
void
setReturnPath(string $returnPath)
Sets the expression allowing the location of the value looked for in the result returned by the request of this source.
The form of this expression depends on the format of the result of the query (returnType):
- json: JSONPath or XPath expression
- xml: XPath expression
- html: XPath expression
- csv: line number / column number
- assocArray: line number / column name
- singleValue : N/A
at line 452
array
getParameters()
Returns the list of parameters passed to the request of this source.
at line 464
void
setParameters(array $parameters)
Sets the list of parameters passed to the request of this source.
at line 476
void
addParameter(Parameter $parameter)
Adds a Parameter object to the list of parameters passed to the request of this source.
at line 488
void
removeParameter(int $index)
Removes a Parameter object from the list of parameters passed to the request of this source.
at line 500
Parameter|null
getParameterByName(string $name)
Retrieves a Parameter object by its name in the list of parameters passed to the request of this source.