atkTextAttribute atkTextAttribute(
string
$name, [int|array
$size = 0], [int
$flags = 0]
)
|
|
Constructor Note that for backwardscompatibility reasons, if you only pass 2 parameters and the second one is not an array, the attribute assumes the second parameters is the $flags param, not the $size param.
Parameters:
|
string |
$name: |
Name of the attribute |
|
int|array |
$size: |
Can be an array with cols and rows key for size and an autoadjust value or just the rows size (in which case $flags is mandatory). |
|
int |
$flags: |
Flags for this attribute |
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.
String db2value(
array
$rec
)
|
|
Removes slashes from the string
Parameters:
|
array |
$rec: |
Array with values |
API Tags:
Redefinition of:
- atkAttribute::db2value()
- Converts a database value to an internal value.
Redefined in descendants as:
Return the database field type of the attribute.
API Tags:
| Return: | The 'generic' type of the database field for this attribute. |
Redefinition of:
- atkAttribute::dbFieldType()
- Return the database field type of the attribute.
void doAutoAdjust(
string
$data,
&$rows,
&$cols, int
$rows, int
$cols
)
|
|
Parses the data that we are going to display in the textfield
and adjust rows to ensure that all the data is actually displayed
Parameters:
|
string |
$data: |
Data we want to display |
|
int |
$rows: |
Rows of the textarea |
|
int |
$cols: |
Columns of the textarea |
|
|
&$rows: |
|
|
|
&$cols: |
|
piece edit(
[array
$record = ""], [String
$fieldprefix = ""], [String
$mode = 'add']
)
|
|
Returns a piece of html code that can be used in a form to edit this attribute's value.
Parameters:
|
array |
$record: |
Array with fields |
|
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: | of html code with a textarea |
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:
void fetchMeta(
array
$metadata
)
|
|
Fetch the metadata about this attrib from the table metadata, and process it.
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.
Returns the current wrap mode.
API Tags:
| Return: | wrap mode |
| Access: | public |
void setWrapMode(
string
$mode
)
|
|
Sets the wrap mode for the text area.
Parameters:
|
string |
$mode: |
wrap mode ('soft', 'hard' or 'off') |
API Tags:
String value2db(
array
$rec
)
|
|
Add's slashes to the string for the database
Parameters:
|
array |
$rec: |
Array with values |
API Tags:
Redefinition of:
- atkAttribute::value2db()
- Converts the internal attribute value to one that is understood by the database.
Redefined in descendants as: