atkDurationAttribute atkDurationAttribute(
string
$name, [string
$resolution = "1m"], [string
$maxtime = "10h"], [int
$flags = 0], [int
$size = 0]
)
|
|
Default Constructor, sets up atkAttribute
Parameters:
|
string |
$name: |
The name of this attribute |
|
string |
$resolution: |
|
|
string |
$maxtime: |
|
|
int |
$flags: |
The falgs of this attribute |
|
int |
$size: |
This attributes size |
API Tags:
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.
String display(
array
$rec, [String
$mode = ""]
)
|
|
This function displays the time
The regular atkAttribute uses PHP's nl2br() and htmlspecialchars() methods to prepare a value for display, unless $mode is "cvs".
Parameters:
|
array |
$rec: |
The record that holds the value for this attribute |
|
String |
$mode: |
The display mode ("view" for viewpages, or "list" for displaying in recordlists, "edit" for displaying in editscreens, "add" for displaying in add screens. "csv" for csv files. Applications can use additional modes. |
API Tags:
Redefinition of:
- atkAttribute::display()
- Returns a displayable string for this value, to be used in HTML pages.
String 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. (hours, minutes and seconds will be a dropdownbox)
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 a of HTML Code |
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
$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.
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
)
|
|
Check if a record has an empty value for this attribute.
Parameters:
|
array |
$record: |
The record that holds this attribute's value. |
Redefinition of:
- atkAttribute::isEmpty()
- Check if a record has an empty value for this attribute.
String search(
[array
$record = ""]
)
|
|
Returns a piece of html code that can be used in a form to search values.
Parameters:
|
array |
$record: |
Array of records, with for each record 2 fields (hours, minutes) |
API Tags:
| Return: | Piece a of HTML Code |
Redefinition of:
- atkAttribute::search()
- Returns a piece of html code that can be used to get search terms input from the user.
string _getHourPart(
mixed
$minutes
)
|
|
Get the hour part from the number of minutes
Parameters:
API Tags:
string _getMinutePart(
mixed
$minutes
)
|
|
Get the minute part from the number of minutes
Parameters:
API Tags:
string _minutes2string(
mixed
$minutes
)
|
|
Convert minutes to string
Parameters:
API Tags:
integer _string2minutes(
string
$value
)
|
|
Convert the value into minutes
Parameters:
API Tags:
| Return: | with number of minutes |