class Parameter

This class allows the storage and retrieval of the attributes of a parameter.

A parameter is the way to pass on values of data or constants either to parameterized queries upon a data source or as the parameter of the web service url of a data source. Therefore, a parameter is always associated with a source.

Properties

private Source $source
private string $type
private string $origin
private string $name
private string $format
private int $data
private string $constant
private bool $optional

Methods

void
__construct(Source $source, string $type)

Constructor of class Parameter

getSource()

Returns the Source object that uses this parameter.

string
getType()

Returns the type of this parameter.

void
setType(string $type)

Sets the type of this parameter.

string
getOrigin()

Returns the origin of this parameter

void
setOrigin(string $origin)

Sets the origin of this parameter

string
getName()

Returns the name of this parameter

void
setName(string $name)

Sets the name of this parameter

string
getFormat()

Returns the format in which the parameter must be provided. Useful only for a parameter of type date.

void
setFormat(string $format)

Sets the format in which the parameter must be provided. Useful only for a parameter of type date.

int
getData()

Returns the id of the data item associated with this parameter. Useful only if origin is equal to 'data'.

void
setData(int $data)

Sets the id of the data item associated with this parameter. Useful only if origin is equal to 'data'.

string
getConstant()

Returns the constant value of this parameter. Useful only if origin is equal to 'constant'.

void
setConstant(string $constant)

Sets the constant value of this parameter. Useful only if origin is equal to 'constant'.

bool
isOptional()

Returns the optional attribute of this parameter.

bool
getOptional()

Returns the optional attribute of this parameter.

void
setOptional(bool $optional)

Determines whether this parameter is optional or not.

Details

at line 113
void __construct(Source $source, string $type)

Constructor of class Parameter

Parameters

Source $source The Source object that uses this parameter.
string $type The type of this parameter

Return Value

void

at line 125
Source getSource()

Returns the Source object that uses this parameter.

Return Value

Source The Source object

at line 144
string getType()

Returns the type of this parameter.

The possible values are:

  • queryString: The parameter is part of the queryString of the url (if the source is a web service with method "GET")
  • path: the parameter is part of the path of the url (if the source is a web service)
  • data: the parameter is a POST data (if the source is a web service with method "POST")
  • columnValue: the parameter is in the where clause of an SQL query (if the source is an internal or external database).
  • header: the parameter is a HTTP header (if the source is a web service).

Return Value

string The type of this parameter

at line 164
void setType(string $type)

Sets the type of this parameter.

The possible values are:

  • queryString: The parameter is part of the queryString of the url (if the source is a web service with method "GET")
  • path: the parameter is part of the path of the url (if the source is a web service)
  • data: the parameter is a POST data (if the source is a web service with method "POST")
  • columnValue: the parameter is in the where clause of a SQL request (if the source is an internal or external database).
  • header: the parameter is a HTTP header (if the source is a web service).

Parameters

string $type The type of this parameter

Return Value

void

at line 180
string getOrigin()

Returns the origin of this parameter

The possible values are:

  • data: the content of this parameter is the value of the data item associated with it.
  • constant: the content of this parameter is a constant value.

Return Value

string The origin of this parameter

at line 197
void setOrigin(string $origin)

Sets the origin of this parameter

The possible values are:

  • data: the content of this parameter is the value of the data item associated with it.
  • constant: the content of this parameter is a constant value.

Parameters

string $origin The origin of this parameter

Return Value

void

at line 210
string getName()

Returns the name of this parameter

Return Value

string The name of this parameter

at line 222
void setName(string $name)

Sets the name of this parameter

Parameters

string $name The name of this parameter

Return Value

void

at line 235
string getFormat()

Returns the format in which the parameter must be provided. Useful only for a parameter of type date.

Return Value

string The format in which the parameter must be provided.

See also

http://php.net/manual/fr/function.date.php to know the characters used in a format.

at line 249
void setFormat(string $format)

Sets the format in which the parameter must be provided. Useful only for a parameter of type date.

Parameters

string $format The format in which the parameter must be provided.

Return Value

void

See also

http://php.net/manual/fr/function.date.php to know the characters used in a format.

at line 260
int getData()

Returns the id of the data item associated with this parameter. Useful only if origin is equal to 'data'.

Return Value

int The id of the data item associated with this parameter.

at line 272
void setData(int $data)

Sets the id of the data item associated with this parameter. Useful only if origin is equal to 'data'.

Parameters

int $data The id of the data item associated with this parameter.

Return Value

void

at line 283
string getConstant()

Returns the constant value of this parameter. Useful only if origin is equal to 'constant'.

Return Value

string The constant value of this parameter.

at line 295
void setConstant(string $constant)

Sets the constant value of this parameter. Useful only if origin is equal to 'constant'.

Parameters

string $constant The constant value of this parameter.

Return Value

void

at line 308
bool isOptional()

Returns the optional attribute of this parameter.

An optional parameter with no value is not passed to the parameterized query or not inserted in the url.

Return Value

bool true if this parameter is optional, false otherwise

at line 321
bool getOptional()

Returns the optional attribute of this parameter.

An optional parameter with no value is not passed to the parameterized query or not inserted in the url.

Return Value

bool true if this parameter is optional, false otherwise

at line 335
void setOptional(bool $optional)

Determines whether this parameter is optional or not.

An optional parameter with no value is not passed to the parameterized query or not inserted in the url.

Parameters

bool $optional true if this parameter is optional, false otherwise

Return Value

void