class Table

This class allows the storage and retrieval of attributes of a table associated with a data item or a data source.

A Table object contains Column objects and Row objects.

If a table is associated with a data item, it represents the contents of that data item.

If a table is associated with a data source, it corresponds to the description of a database table.

Properties

private Data $data
private int $id
private string $name
private string $label
private RichText|string|null $description
private array $columns
private array $rows

Methods

void
__construct(Data|null $data, int $id)

Constructor of class Table

int
getId()

Returns the ID of this table

void
setId(int $id)

Sets the ID of this table

string
getName()

Returns the name of this table

void
setName(string $name)

Sets the name of this table

Data|null
getData()

Returns the Data object of type 'table' associated with this this table

string
getLabel()

Returns the label of this table

void
setLabel(string $label)

Sets the label of this table

RichText|string|null
getDescription()

Returns the description of this table

void
setDescription(RichText|string $description)

Sets the description of this table

array
getColumns()

Returns the list of columns of this table

void
setColumns(array $columns)

Sets the list of columns of this table

void
addColumn(Column $column)

Adds a Column object to the list of columns of this table

getColumn(int $index)

Returns the Column object at the given index in the list of columns of this table

void
removeColumn(int $index)

Removes a Column object from the list of columns of this table

Column|null
getColumnById(int $id)

Retrieves a Column object by its ID in the list of columns of this table.

array
getRows()

Returns the list of rows of this table

void
setRows(array $rows)

Sets the list of rows of this table

void
addRow(Row $row)

Adds a Row object to the list of rows of this table

int
getRow(int $index)

Returns the Row object at the given index in the list of rows of this table

void
removeRow(int $index)

Removes a Row object to the list of rows of this table

Details

at line 109
void __construct(Data|null $data, int $id)

Constructor of class Table

Parameters

Data|null $data The Data object of type 'table' associated with this this table
int $id The ID of this table

Return Value

void

at line 121
int getId()

Returns the ID of this table

Return Value

int The ID of this table

at line 133
void setId(int $id)

Sets the ID of this table

Parameters

int $id The ID of this table

Return Value

void

at line 144
string getName()

Returns the name of this table

Return Value

string The name of this table

at line 156
void setName(string $name)

Sets the name of this table

Parameters

string $name The name of this table

Return Value

void

at line 169
Data|null getData()

Returns the Data object of type 'table' associated with this this table

Returns null if this table is the description of a database table.

Return Value

Data|null The Data object

at line 180
string getLabel()

Returns the label of this table

Return Value

string The label of this table

at line 192
void setLabel(string $label)

Sets the label of this table

Parameters

string $label The label of this table

Return Value

void

at line 203
RichText|string|null getDescription()

Returns the description of this table

Return Value

RichText|string|null The description of this table

at line 215
void setDescription(RichText|string $description)

Sets the description of this table

Parameters

RichText|string $description The description of this table

Return Value

void

at line 226
array getColumns()

Returns the list of columns of this table

Return Value

array The list of columns

at line 238
void setColumns(array $columns)

Sets the list of columns of this table

Parameters

array $columns The list of columns

Return Value

void

at line 250
void addColumn(Column $column)

Adds a Column object to the list of columns of this table

Parameters

Column $column The Column object

Return Value

void

at line 262
Column getColumn(int $index)

Returns the Column object at the given index in the list of columns of this table

Parameters

int $index The index of the column in the list of columns

Return Value

Column The Column object

at line 274
void removeColumn(int $index)

Removes a Column object from the list of columns of this table

Parameters

int $index The index of the column in the list of columns

Return Value

void

at line 286
Column|null getColumnById(int $id)

Retrieves a Column object by its ID in the list of columns of this table.

Parameters

int $id The ID of the column

Return Value

Column|null The Column object

at line 302
array getRows()

Returns the list of rows of this table

Return Value

array The list of rows

at line 314
void setRows(array $rows)

Sets the list of rows of this table

Parameters

array $rows The list of rows

Return Value

void

at line 326
void addRow(Row $row)

Adds a Row object to the list of rows of this table

Parameters

Row $row The Row object

Return Value

void

at line 338
int getRow(int $index)

Returns the Row object at the given index in the list of rows of this table

Parameters

int $index The index of the row in the list of rows

Return Value

int the value of row

at line 350
void removeRow(int $index)

Removes a Row object to the list of rows of this table

Parameters

int $index The index of the row in the list of rows

Return Value

void