atkMlAttribute atkMlAttribute(
string
$name, [int
$flags = 0], [int
$size = 0]
)
|
|
Constructor
Parameters:
|
string |
$name: |
name of the attribute |
|
int |
$flags: |
flags for the attribute |
|
int |
$size: |
The size of the attribute |
void addToEditArray(
String
$mode,
&$arr,
&$defaults,
&$error, String
$fieldprefix, array
$arr, array
$defaults, array
$error
)
|
|
Adds the attribute's edit / hide HTML code to the edit array.
This method is called by the node if it wants the data needed to create an edit form.
Parameters:
|
String |
$mode: |
the edit mode ("add" or "edit") |
|
array |
$arr: |
pointer to the edit array |
|
array |
$defaults: |
pointer to the default values array |
|
array |
$error: |
pointer to the error array |
|
String |
$fieldprefix: |
the fieldprefix |
|
|
&$arr: |
|
|
|
&$defaults: |
|
|
|
&$error: |
|
Redefinition of:
- atkAttribute::addToEditArray()
- Adds the attribute's edit / hide HTML code to the edit array.
Redefined in descendants as:
void addToQuery(
&$query, [String
$tablename = ""], [String
$fieldaliasprefix = ""], Array
$rec, int
$level, String
$mode, atkQuery
$query
)
|
|
Adds this attribute to database queries.
Database queries (select, insert and update) are passed to this method so the attribute can 'hook' itself into the query.
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:
- atkAttribute::addToQuery()
- Adds this attribute to database queries.
Redefined in descendants as:
array db2value(
array
$rec
)
|
|
Removes slashes from the strings
Parameters:
|
array |
$rec: |
array with values |
API Tags:
| Return: | with string without slashes |
Redefinition of:
- atkAttribute::db2value()
- Converts a database value to an internal value.
string display(
array
$record
)
|
|
Returns a displayable string for this value.
We always display the first language only.
Parameters:
|
array |
$record: |
array with values |
API Tags:
| Return: | ready for displaying |
Redefinition of:
- atkAttribute::display()
- Returns a displayable string for this value, to be used in HTML pages.
Redefined in descendants as:
piece edit(
[array
$record = ""], [string
$fieldprefix = ""], [string
$mode = ""]
)
|
|
Returns a piece of html code that can be used in a form to edit this attribute's value (one box which can be used for all the languages).
Parameters:
|
array |
$record: |
array with values |
|
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:
Redefinition of:
- atkAttribute::edit()
- Returns a piece of html code that can be used in a form to edit this attribute's value.
Redefined in descendants as:
-
atkMlSelectorAttribute::edit()
: Returns a piece of html code that can be used in a form to edit this attribute's value.
-
atkMlTextAttribute::edit()
: Returns a piece of html code that can be used in a form to edit this attribute's value.
-
atkMlFckAttribute::edit()
: Returns the piece of HTML that can be used to edit the field's value. In this particular occassion we will include the FCK library and setup the right parameters for this particular set of editors.
void fetchMeta(
array
$metadata
)
|
|
Fetch the metadata about this attrib from the table metadata
Parameters:
|
array |
$metadata: |
The table metadata from the table for this attribute. |
Redefinition of:
- atkAttribute::fetchMeta()
- Fetch the metadata about this attrib from the table metadata, and process it.
array fetchValue(
array
$rec
)
|
|
Fetch values
Parameters:
|
array |
$rec: |
array with values |
API Tags:
Redefinition of:
- atkAttribute::fetchValue()
- Convert values from an HTML form posting to an internal value for this attribute.
Return the possible languages
API Tags:
| Return: | with supported languages |
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:
- atkAttribute::getSearchCondition()
- Creates a searchcondition for the field, was once part of searchCondition, however, searchcondition() also immediately adds the search condition.
the getValue(
array
$rec, [string
$language = ""]
)
|
|
Get the value of this attribute for the given language
Parameters:
|
array |
$rec: |
The record |
|
string |
$language: |
The language |
API Tags:
| Return: | value of this attribute for the given languager |
Piece hide(
[array
$record = ""]
)
|
|
Returns a piece of html code that can be used in a form to display hidden values for this attribute.
Parameters:
|
array |
$record: |
Array with values |
API Tags:
Redefinition of:
- atkAttribute::hide()
- Returns a piece of html code for hiding this attribute in an HTML form, while still posting its value. (<input type="hidden">)
Redefined in descendants as:
boolean isEmpty(
array
$record
)
|
|
Check if the attribute is empty for all languages
Parameters:
|
array |
$record: |
Current record |
API Tags:
| Return: | true if it's empty |
Redefinition of:
- atkAttribute::isEmpty()
- Check if a record has an empty value for this attribute.
Is the node an multilanguage node?
piece search(
[array
$record = ""], [boolean
$extended = false], [string
$fieldprefix = ""]
)
|
|
Returns a piece of html code that can be used to search the attribute.
We will use the default language for this!
Parameters:
|
array |
$record: |
array with values |
|
boolean |
$extended: |
if set to false, a simple search input is returned for use in the searchbar of the recordlist. If set to true, a more extended search may be returned for the 'extended' search page. The atkAttribute does not make a difference for $extended is true, but derived attributes may reimplement this. |
|
string |
$fieldprefix: |
The fieldprefix of this attribute's HTML element. |
API Tags:
Redefinition of:
- atkAttribute::search()
- Returns a piece of html code that can be used to get search terms input from the user.
Redefined in descendants as:
String value2db(
array
$rec
)
|
|
Converts the internal attribute value to one that is understood by the database.
Parameters:
|
array |
$rec: |
The record that holds this attribute's value. |
API Tags:
| Return: | The database compatible value |
Redefinition of:
- atkAttribute::value2db()
- Converts the internal attribute value to one that is understood by the database.
Redefined in descendants as: