atkManyToManySelectRelation __construct(
string
$name, string
$link, string
$destination, [int
$flags = 0]
)
|
|
Constructs a new many-to-many select relation.
Parameters:
|
string |
$name: |
The name of the relation |
|
string |
$link: |
The full name of the node that is used as intermediairy node. The intermediairy node is assumed to have 2 attributes that are named after the nodes at both ends of the relation. For example, if node 'project' has a M2M relation with 'activity', then the intermediairy node 'project_activity' is assumed to have an attribute named 'project' and one that is named 'activity'. You can set your own keys by calling setLocalKey() and setRemoteKey() |
|
string |
$destination: |
The full name of the node that is the other end of the relation. |
|
int |
$flags: |
Flags for the relation. |
API Tags:
Redefined in descendants as:
void addDestinationFilter(
string
$filter
)
|
|
Adds a filter value to the destination filter.
Parameters:
API Tags:
Redefinition of:
- atkRelation::addDestinationFilter()
- Adds a filter value to the destination filter.
boolean createDestination(
)
|
|
Create the instance of the destination and copy the destination to the the many to one relation
If succesful, the instance is stored in the m_destInstance member variable.
API Tags:
| Return: | true if succesful, false if something went wrong. |
| Access: | public |
Redefinition of:
- atkRelation::createDestination()
- Create the instance of the destination.
string edit(
array
$record, [String
$fieldprefix = ""], [String
$mode = ""]
)
|
|
Return a piece of html code to edit the attribute.
Parameters:
|
array |
$record: |
The record that holds the value for this attribute. |
|
String |
$fieldprefix: |
The fieldprefix to put in front of the name of any html form element for this attribute. |
|
String |
$mode: |
The mode we're in ('add' or 'edit') |
API Tags:
| Return: | piece of html code |
| Access: | public |
Redefinition of:
- atkManyToManyRelation::edit()
- Dummy function
string getActionLink(
string
$action, array
$record
)
|
|
This method returns the HTML for the link of a certain action
Parameters:
|
string |
$action: |
|
|
array |
$record: |
|
API Tags:
string getDeleteActionLink(
array
$record
)
|
|
The default delete link
Parameters:
API Tags:
string getEditActionLink(
array
$record
)
|
|
The default edit link
Parameters:
API Tags:
String getLabel(
[array
$record = array()], [string
$mode = '']
)
|
|
Get the HTML label of the attribute.
The difference with the label() method is that the label method always returns the HTML label, while the getLabel() method is 'smart', by taking the AF_NOLABEL and AF_BLANKLABEL flags into account.
Parameters:
|
array |
$record: |
The record holding the value for this attribute. |
|
string |
$mode: |
The mode ("add", "edit" or "view") |
API Tags:
| Return: | The HTML compatible label for this attribute, or an empty string if the label should be blank, or NULL if no label at all should be displayed. |
Redefinition of:
- atkAttribute::getLabel()
- Get the HTML label of the attribute.
Return the many-to-one relation we will use for the selection of new records etc.
API Tags:
string getPositionAttribute(
)
|
|
Get the positional attribute of the many to many join. It is the column in the join table that denotes the position of the item in the set.
API Tags:
| Return: | the position column name of the join |
| Access: | public |
array getSelectedKeys(
array
$record, String
$id, [
$enforceUnique = true], int
$uniqueFilter
)
|
|
Return the selected keys for a given record
Parameters:
|
array |
$record: |
The record that holds the value for this attribute. |
|
String |
$id: |
is the html id of the relation |
|
int |
$uniqueFilter: |
is the type of array_unique filter to use on the results. Use boolean false to dissable |
|
|
$enforceUnique: |
|
API Tags:
| Return: | of selected keys in the order they were submitted |
| Access: | public |
boolean hasPositionAttribute(
)
|
|
Check if positon attribute is set
API Tags:
| Return: | true if the position attribute has been set |
| Access: | public |
Initialize.
API Tags:
Redefinition of:
- atkAttribute::init()
- This function is called right after the attribute is added to the node.
void load(
atkDb
$db, array
$record, string
$mode
)
|
|
Load function.
Parameters:
|
atkDb |
$db: |
database instance. |
|
array |
$record: |
record |
|
string |
$mode: |
load mode |
API Tags:
Redefinition of:
- atkManyToManyRelation::load()
- load function
void orderSelectedRecords(
&$selectedRecords,
$selectedKeys, array
$selectedRecords, array
$selectedKey
)
|
|
Order selected records in the same way as the selected keys. We only do this if the position attribute has been set.
Parameters:
|
array |
$selectedRecords: |
selected records |
|
array |
$selectedKey: |
selected keys |
|
|
&$selectedRecords: |
|
|
|
$selectedKeys: |
|
API Tags:
void partial_selectedrecord(
)
|
|
Partial selected record.
API Tags:
void recordActions(
array
$record, array
&$actions
)
|
|
Function that is called for each record in a recordlist, to determine what actions may be performed on the record.
Parameters:
|
array |
$record: |
The record for which the actions need to be determined. |
|
array |
&$actions: |
Reference to an array with the already defined actions. |
void renderAdditionField(
$record, string
$fieldprefix, string
$mode
)
|
|
Render addition field.
Parameters:
|
string |
$fieldprefix: |
field prefix |
|
string |
$mode: |
|
|
|
$record: |
|
API Tags:
void renderSelectedRecord(
array
$record, string
$fieldprefix
)
|
|
Render selected record.
Parameters:
|
array |
$record: |
selected record |
|
string |
$fieldprefix: |
field prefix |
API Tags:
void renderSelectedRecordActions(
$record
)
|
|
Parameters:
API Tags:
void setAutoCompleteCaseSensitive(
array
$caseSensitive
)
|
|
Set the case-sensitivity for the autocompletion search (true or false).
Parameters:
API Tags:
void setAutoCompleteMinChars(
int
$chars
)
|
|
Sets the minimum number of characters before auto-completion kicks in.
Parameters:
API Tags:
void setAutoCompleteSearchFields(
array
$searchFields
)
|
|
Set the searchfields for the autocompletion. By default the descriptor fields are used.
Parameters:
API Tags:
void setAutoCompleteSearchMode(
array
$mode
)
|
|
Set the searchmode for the autocompletion: exact, startswith(default) or contains.
Parameters:
API Tags:
void setDestinationFilter(
string
$filter
)
|
|
Sets the destination filter.
Parameters:
API Tags:
Redefinition of:
- atkRelation::setDestinationFilter()
- Sets the destination filter.
void setPositionAttribute(
string
$attr, [string
$htmlIdentifier = null]
)
|
|
Set the positional attribute/column of the many to many join. It is the column in the join table that denotes the position of the item in the set.
Parameters:
|
string |
$attr: |
the position attribute/column name of the join |
|
string |
$htmlIdentifier: |
is the html string to add to the end of the label. Defaults to an up down image. |
API Tags:
array _createRecord(
array
$selectedKey, array
$selectedRecord, array
$ownerRecord, int
$index
)
|
|
Perform the create action on a record that is new
Parameters:
|
array |
$selectedKey: |
the selected keys |
|
array |
$selectedRecord: |
the selected record |
|
array |
$ownerRecord: |
the owner record |
|
int |
$index: |
the index of the item in the set |
API Tags:
| Return: | the newly created record |
| Access: | protected |
Redefinition of:
- atkManyToManyRelation::_createRecord()
- Create new link record.
boolean _updateRecord(
array
$record, int
$index
)
|
|
Perform the update action on a record that's been changed
Parameters:
|
array |
$record: |
the record that has been changed |
|
int |
$index: |
the index of the item in the set |
API Tags:
| Return: | true if the update was performed successfuly, false if there were issues |
| Access: | protected |
Redefinition of:
- atkManyToManyRelation::_updateRecord()
- Update existing link record.