atkSecureRelation atkSecureRelation(
string
$name, string
$destination, string
$linktable, string
$linkfield, string
$linkbackfield, int
$keylength, [
$refKey = ""], string
$encryption, [int
$flags = 0], string
$refKey=""
)
|
|
Creates an atkSecureRelation, similar to an atkOneToOne relation only encrypted
Parameters:
|
string |
$name: |
The unique name of the attribute. In slave mode, this corresponds to the foreign key field in the database table. |
|
string |
$destination: |
The destination node (in module.nodename notation) |
|
string |
$linktable: |
The table we link to |
|
string |
$linkfield: |
The field we link to |
|
string |
$linkbackfield: |
|
|
int |
$keylength: |
The length of the encryption key |
|
string |
$refKey="": |
In master mode, this specifies the foreign key field from the destination node that points to the master record. In slave mode, this parameter should be empty. |
|
string |
$encryption: |
The encryption to use |
|
int |
$flags: |
Attribute flags that influence this attributes' behavior. |
|
|
$refKey: |
|
void addToListArrayHeader(
String
$action,
&$arr, String
$fieldprefix, int
$flags, array
$atksearch, String
$atkorderby, array
$arr
)
|
|
Adds the attribute / field to the list header. This includes the column name and search field.
Framework method. It should not be necessary to call this method directly.
Parameters:
|
String |
$action: |
the action that is being performed on the node |
|
array |
$arr: |
reference to the the recordlist array |
|
String |
$fieldprefix: |
the fieldprefix |
|
int |
$flags: |
the recordlist flags |
|
array |
$atksearch: |
the current ATK search list (if not empty) |
|
String |
$atkorderby: |
the current ATK orderby string (if not empty) |
|
|
&$arr: |
|
Redefinition of:
- atkOneToOneRelation::addToListArrayHeader()
- Adds the attribute / field to the list header. This includes the column name and search field.
void addToQuery(
&$query, [String
$tablename = ""], [String
$fieldaliasprefix = ""], [Array
$rec = ""], [int
$level = 0], [String
$mode = ""], atkQuery
$query
)
|
|
This function in the atkOneToOneRelation store the record of the parentnode in the DB with the reference key of the other table.
So we encrypt the reference key before we call the method. For more documentation see the atkOneToOneRelation
Parameters:
|
atkQuery |
$query: |
The SQL query object |
|
String |
$tablename: |
The name of the table of this attribute |
|
String |
$fieldaliasprefix: |
Prefix to use in front of the alias in the query. |
|
Array |
$rec: |
The record that contains the value of this attribute. |
|
int |
$level: |
Recursion level if relations point to eachother, an endless loop could occur if they keep loading eachothers data. The $level is used to detect this loop. If overriden in a derived class, any subcall to an addToQuery method should pass the $level+1. |
|
String |
$mode: |
Indicates what kind of query is being processing: This can be any action performed on a node (edit, add, etc) Mind you that "add" and "update" are the actions that store something in the database, whereas the rest are probably select queries. |
|
|
&$query: |
|
Redefinition of:
- atkOneToOneRelation::addToQuery()
- Adds this attribute to database queries.
string decrypt(
array
$record, array
$field
)
|
|
Decrypt the field
Parameters:
|
array |
$record: |
|
|
array |
$field: |
|
API Tags:
| Return: | The decrypted value |
string getLinkPassword(
string
$linktable, string
$linkfield, [string
$encryption = ""]
)
|
|
Gets the password for the link for more security the administrator gets a random password. You have to capture in your application that the administrator is only able to insert the first record in this relation and make also a useracount with it.
Parameters:
|
string |
$linktable: |
the table where we find the linkpass |
|
string |
$linkfield: |
the field where we find the encrypted linkpass |
|
string |
$encryption: |
The encryption to use |
API Tags:
| Return: | the password for the link |
String getSearchCondition(
&$query, String
$table, mixed
$value, String
$searchmode, atkQuery
$query
)
|
|
Creates a searchcondition for the field, was once part of searchCondition, however, searchcondition() also immediately adds the search condition.
Parameters:
|
atkQuery |
$query: |
The query object where the search condition should be placed on |
|
String |
$table: |
The name of the table in which this attribute is stored |
|
mixed |
$value: |
The value the user has entered in the searchbox |
|
String |
$searchmode: |
The searchmode to use. This can be any one of the supported modes, as returned by this attribute's getSearchModes() method. |
|
|
&$query: |
|
API Tags:
| Return: | The searchcondition to use. |
Redefinition of:
- atkOneToOneRelation::getSearchCondition()
- Creates a searchcondition for the field, was once part of searchCondition, however, searchcondition() also immediately adds the search condition.
array load(
&$db, array
$record, string
$mode, atkDb
$db
)
|
|
This function in the atkOneToOneRelation loads the record of the childnode from the DB with the the id from de reference key in childnode.
So we decrypt the reference key before we call the method. For more documentation see the atkOneToOneRelation
Parameters:
|
atkDb |
$db: |
The database object |
|
array |
$record: |
The record |
|
string |
$mode: |
The mode we're in ("add", "edit", "copy") |
|
|
&$db: |
|
API Tags:
| Return: | The loaded records |
Redefinition of:
- atkOneToOneRelation::load()
- Retrieve detail records from the database.
int loadType(
String
$mode, [bool
$searching = false]
)
|
|
Determine the load type of this attribute.
Parameters:
|
String |
$mode: |
The type of load (view,admin,edit etc) |
|
bool |
$searching: |
Is this a search? |
API Tags:
| Return: | Bitmask containing information about load requirements. POSTLOAD|ADDTOQUERY when AF_ONETOONE_LAZY is set. ADDTOQUERY when AF_ONETOONE_LAZY is not set. |
Redefinition of:
- atkOneToOneRelation::loadType()
- Determine the load type of this attribute.
void newUser(
string
$id, string
$pass
)
|
|
For creating a new user put the linkpassword in the db
Parameters:
|
string |
$id: |
the id of the user to create |
|
string |
$pass: |
the password for the user |
void searchCondition(
&$query, String
$table, mixed
$value, String
$searchmode, [string
$fieldaliasprefix = ''], atkQuery
$query
)
|
|
Creates a search condition for a given search value, and adds it to the query that will be used for performing the actual search.
Parameters:
|
atkQuery |
$query: |
The query to which the condition will be added. |
|
String |
$table: |
The name of the table in which this attribute is stored |
|
mixed |
$value: |
The value the user has entered in the searchbox |
|
String |
$searchmode: |
The searchmode to use. This can be any one of the supported modes, as returned by this attribute's getSearchModes() method. |
|
string |
$fieldaliasprefix: |
optional prefix for the fieldalias in the table |
|
|
&$query: |
|
Redefinition of:
- atkAttribute::searchCondition()
- Creates a search condition for a given search value, and adds it to the query that will be used for performing the actual search.
void setCacheField(
[string
$fieldname = "cache"]
)
|
|
Set the name of the cache field
Parameters:
|
string |
$fieldname: |
The cache fieldname |
void _getJoinCondition(
)
|
|
Returns the condition which can be used when calling atkQuery's addJoin() method
Joins the relation's owner with the destination