atkBoolAttribute atkBoolAttribute(
string
$name, [int
$flags = 0]
)
|
|
Constructor
Parameters:
|
string |
$name: |
Name of the attribute |
|
int |
$flags: |
Flags for this attribute |
atkAttribute addFlag(
int
$flags
)
|
|
Adds the AF_OBLIGATORY flag to the attribute.
Parameters:
|
int |
$flags: |
The flag to add to the attribute |
API Tags:
| Return: | The instance of this atkAttribute |
Redefinition of:
- atkAttribute::addFlag()
- Adds a flag to the attribute.
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.
yes display(
array
$record
)
|
|
Returns a displayable string for this value.
Parameters:
|
array |
$record: |
Array with boolean field |
API Tags:
Redefinition of:
- atkAttribute::display()
- Returns a displayable string for this value, to be used in HTML pages.
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.
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: | of html code with a checkbox |
Redefinition of:
- atkAttribute::edit()
- Returns a piece of html code that can be used in a form to edit this attribute's value.
String fetchValue(
array
$postvars
)
|
|
Convert values from an HTML form posting to an internal value for this attribute.
Parameters:
|
array |
$postvars: |
The array with html posted values ($_POST, for example) that holds this attribute's value. |
API Tags:
| Return: | The internal value |
Redefinition of:
- atkAttribute::fetchValue()
- Convert values from an HTML form posting to an internal value for this attribute.
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.
String getSearchCondition(
&$query, String
$table, mixed
$value, String
$searchmode, atkQuery
$query
)
|
|
Creates a searchcondition for the field
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.
Retrieve the list of searchmodes supported by the attribute.
API Tags:
| Return: | List of supported searchmodes |
Redefinition of:
- atkAttribute::getSearchModes()
- Retrieve the list of searchmodes supported by the attribute.
String hide(
[array
$record = ""], [String
$fieldprefix = ""]
)
|
|
Returns a piece of html code for hiding this attribute in an HTML form, while still posting its value. (<input type="hidden">)
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. |
API Tags:
| Return: | A piece of htmlcode with hidden form elements that post this attribute's value without showing it. |
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">)
boolean isEmpty(
array
$record
)
|
|
Is empty?
Parameters:
API Tags:
Redefinition of:
- atkAttribute::isEmpty()
- Check if a record has an empty value for this attribute.
The label(
[array
$record = array()]
)
|
|
Return the label of the field.
Parameters:
|
array |
$record: |
The record that holds the value of this attribute |
API Tags:
| Return: | label for this attribute |
Redefinition of:
- atkAttribute::label()
- Return the label of the attribute.
boolean parseStringValue(
String
$stringvalue
)
|
|
Convert a String representation into an internal value.
This implementation converts 'y/j/yes/on/true/1/*' to 1 All other values are converted to 0
Parameters:
|
String |
$stringvalue: |
The value to parse. |
API Tags:
Redefinition of:
- atkAttribute::parseStringValue()
- Convert a String representation into an internal value.
piece search(
[array
$record = ""], [boolean
$extended = false], [string
$fieldprefix = ""]
)
|
|
Returns a piece of html code that can be used in a form to search for values
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:
| Return: | of html code with a checkbox |
Redefinition of:
- atkAttribute::search()
- Returns a piece of html code that can be used to get search terms input from the user.
String value2db(
array
$rec
)
|
|
Get the value if it exits, otherwise return 0
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.