Class: atkmlsplitter
Source Location: /utils/class.atkmlsplitter.inc
Class atkmlsplitter
Class Overview
|
This class is responsible for managing multilanguage nodes which have multiple records per occurance.
It updates/saves or merges multiple records. This is used by multilingual atkNodes. It should generally not be necessary to use this class directly.
Located in /utils/class.atkmlsplitter.inc [line 31]
Wiki documentation
Author(s):
Information Tags:
|
Methods
|
Method Summary
| void |
combineMlRecordSet() |
merges multiple multilanguage records to one record with fields containing arrays needed by mlattributes |
| array |
getMlNodes() |
this is used to find 1:1 relations with multilanguage support we need these relation because the recordlist will have them included when editting a record we have to combine these records |
| void |
updateMlRecords() |
add/update multiple language records because nodes are cached and we have to make some attribute modifications you can't pass the node as a reference!! |
Methods
array addLngRecords(
&$node,
&$recordset, atkNode
$node, array
$recordset
)
|
|
Add language records
Parameters:
|
atkNode |
$node: |
|
|
array |
$recordset: |
|
|
|
&$node: |
|
|
|
&$recordset: |
|
API Tags:
| Return: | Array with records to add |
void addMlCondition(
&$query,
&$node, string
$mode, string
$joinalias, atkQuery
$query, atkNode
$node
)
|
|
Adds language condition
Parameters:
|
atkQuery |
$query: |
|
|
atkNode |
$node: |
|
|
string |
$mode: |
|
|
string |
$joinalias: |
|
|
|
&$query: |
|
|
|
&$node: |
|
void combineMlRecordSet(
&$node,
&$recordset, atkQuery
$query, atkNode
$node, array
$recordset
)
|
|
merges multiple multilanguage records to one record with fields containing arrays needed by mlattributes
Parameters:
Retrieve the mlsplitter instance
API Tags:
array getLanguages(
&$node, atkNode
$node
)
|
|
Get supported languages
Parameters:
API Tags:
| Return: | Array with supported languages |
array getMlNodes(
&$node, atkNode
$node
)
|
|
this is used to find 1:1 relations with multilanguage support we need these relation because the recordlist will have them included when editting a record we have to combine these records
Parameters:
API Tags:
| Return: | Array with relationnames |
bool hasLngRecord(
&$node,
&$recordset, string
$lng,
&$index, atkNode
$node, array
$recordset, int
$index
)
|
|
Has language record?
Parameters:
|
atkNode |
$node: |
|
|
array |
$recordset: |
|
|
string |
$lng: |
|
|
int |
$index: |
|
|
|
&$node: |
|
|
|
&$recordset: |
|
|
|
&$index: |
|
void mergeMlRecords(
&$node,
&$recordset, atkNode
$node, array
$recordset
)
|
|
Merge multilanguage records
Parameters:
|
atkNode |
$node: |
|
|
array |
$recordset: |
|
|
|
&$node: |
|
|
|
&$recordset: |
|
int searchRecordDefaultLanguage(
array
$recordset, string
$defaultlanguage
)
|
|
Search the recordset for the default language
Parameters:
|
array |
$recordset: |
|
|
string |
$defaultlanguage: |
|
API Tags:
| Return: | The position in the recordset array where the defaultlanguage is found |
bool updateLngField(
&$node,
&$record, atkNode
$node, array
$record
)
|
|
Update the language field
Parameters:
|
atkNode |
$node: |
|
|
array |
$record: |
|
|
|
&$node: |
|
|
|
&$record: |
|
void updateMlRecords(
atkNode
$node, array
$record, [string
$mode = "add"]
)
|
|
add/update multiple language records because nodes are cached and we have to make some attribute modifications you can't pass the node as a reference!!
Parameters:
|
atkNode |
$node: |
|
|
array |
$record: |
|
|
string |
$mode: |
|