Item __construct(
[Unit
$unit = NULL], [mixed
$source = NULL]
)
|
|
Instance constructor. Creates object from SQL result row, loads by ID or just leaves blank to be filled later.
Parameters:
Unit |
$unit: |
Reference to parent unit |
mixed |
$source: |
ID or query result row |
API Tags:
Redefinition of:
- Instance::__construct()
- Creates object from SQL result row or array of parameter values or blank to be filled later.
Redefined in descendants as:
-
Link::__construct()
: Instance constructor. Creates object from SQL result row, loads by ID or just leaves blank to be filled later.
void display(
XTemplate
$tpl, string
$block
)
|
|
Single object display using XTemplate object.
Controller logic for XTemplate: assings tags, parses blocks. TPL designer must specify unit parameters explicitly. TPL example: <!-- BEGIN: MY_UNIT --> <stong>{FOO_TITLE}:</strong> {FOO} <stong>{BAR_TITLE}:</strong> {BAR} <!-- END: MY_UNIT -->
Parameters:
XTemplate |
$tpl: |
Layout template object |
string |
$block: |
Full block name to render the object in, e.g. 'MAIN.MY_UNIT' |
API Tags:
Redefined in descendants as:
-
Link::display()
: Row-based automatic unit render TPL designer specifies parameters implicitly with row block.
void display_auto(
XTemplate
$tpl, string
$block, [string
$row_block = 'PARAM'], [string
$title_tag = 'PARAM_TITLE'], [string
$value_tag = 'PARAM_VALUE']
)
|
|
Row-based automatic unit render TPL designer specifies parameters implicitly with row block.
TPL example: <!-- BEGIN: MY_UNIT --> <!-- BEGIN: MY_PARAM --> <stong>{PARAM_TITLE}:</strong> {PARAM_VALUE} <!-- END: MY_PARAM --> <!-- END: MY_UNIT -->
Parameters:
XTemplate |
$tpl: |
Layout template object |
string |
$block: |
Full block name to render the object in, e.g. 'MAIN.MY_UNIT' |
string |
$row_block: |
Row block name for parameter row, e.g. 'MY_PARAM' |
string |
$title_tag: |
Tag name for parameter title |
string |
$value_tag: |
Tag name for parameter value |
API Tags:
Item get_referenced_item(
string
$param_name
)
|
|
Gets a referenced object as result row to be passed to exact class constructor
Parameters:
string |
$param_name: |
Reference parameter name |
API Tags:
Return: | An item that is referenced to |
Access: | public |
array get_referencing_items(
Unit
$unit, [string
$param_name = '']
)
|
|
Gets all items which reference to this item with a specific entity parameter.
Parameters:
Unit |
$unit: |
Unit that references to this unit |
string |
$param_name: |
Referencing parameter name |
API Tags:
Return: | List of Items |
Access: | public |
array get_related_items(
Unit
$unit, Relation
$relation, [string
$relation_source = ''], [string
$relation_target = '']
)
|
|
Gets items from another Unit which reference to this Item with a many-to-many Relation
Parameters:
Unit |
$unit: |
Target unit which relates to this unit |
Relation |
$relation: |
Relation which connects units |
string |
$relation_source: |
Relation parameter name which references to this item |
string |
$relation_target: |
Relation parameter which references to target unit |
API Tags:
Return: | List of Items |
Access: | public |
bool import(
[string
$method = 'P'], [string
$prefix = NULL]
)
|
|
Imports data from user input, validates it and stores in the object
Parameters:
string |
$method: |
Input method 'P' for POST or 'G' for GET |
string |
$prefix: |
Input name prefix, defaults to database column prefix |
API Tags:
Return: | TRUE on successfull validation or FALSE if validation has failed |
See: | Unit::display_add() |
Access: | public |
Loads object from database
Parameters:
API Tags:
Return: | TRUE on success, FALSE on error |
Access: | public |