atkFuzzySearchAttribute atkFuzzySearchAttribute(
String
$name, String
$searchnode, String
$callback, [String
$mode = "all"], [int
$flags = 0], [int
$size = 0]
)
|
|
The fuzzySearchAttribute, with this you can search a node for certain keywords and get a selectable list of records that match the keywords.
Possible modes:
- all (default) return everything
- first return only the first result
- firstperkeyword return the first result per keyword
- select make the user select
- selectperkeyword make the user select for every keyword
- multiselect ?
Parameters:
|
String |
$name: |
The name of the attribute |
|
String |
$searchnode: |
The node to search on |
|
String |
$callback: |
The function of the owner node to call with the record to store and the results of the search Has to return a status (true or false) |
|
String |
$mode: |
The mode of the search (all(default)|first|firstperkeyword| select|selectperkeyword|multiselect) |
|
int |
$flags: |
The flags of the attribute |
|
int |
$size: |
The size of the search field |
void addSearchFilter(
String
$filter, [String
$value = ""]
)
|
|
Adds a filter on the instance of the searchnode
Parameters:
|
String |
$filter: |
The fieldname you want to filter OR a SQL where clause expression. |
|
String |
$value: |
Required value. (Ommit this parameter if you pass an SQL expression for $filter.) |
Redefined in descendants as:
Dummy method to prevent loading/storing of data.
Redefinition of:
- atkAttribute::addToQuery()
- Adds this attribute to database queries.
Redefined in descendants as:
boolean createSearchNodeInstance(
)
|
|
Creates an instance of the node we are searching on and stores it in a member variable ($this->m_searchnodeInstance)
Dummy method to prevent loading/storing of data.
Redefinition of:
- atkAttribute::dbFieldSize()
- Return the size of the field in the database.
Redefined in descendants as:
Dummy method to prevent loading/storing of data.
Redefinition of:
- atkAttribute::dbFieldType()
- Return the database field type of the attribute.
Redefined in descendants as:
String edit(
[array
$rec = ""], [String
$prefix = ""], [String
$mode = ""]
)
|
|
Returns a piece of html code that can be used in a form to edit this attribute's value.
Parameters:
|
array |
$rec: |
The record that holds the value for this attribute. |
|
String |
$prefix: |
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: | A piece of htmlcode for editing this attribute |
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:
Dummy method to prevent loading/storing of data.
Redefinition of:
- atkAttribute::fetchMeta()
- Fetch the metadata about this attrib from the table metadata, and process it.
Redefined in descendants as:
String getDestinationFilter(
)
|
|
Returns the destination filter.
API Tags:
| Return: | The destination filter. |
Array getMatches(
String
$searchstring
)
|
|
The actual function that does the searching
Parameters:
|
String |
$searchstring: |
The string to search for |
API Tags:
Redefined in descendants as:
void getSearchCondition(
)
|
|
Dummy method to prevent loading/storing of data.
Redefinition of:
- atkAttribute::getSearchCondition()
- Creates a searchcondition for the field, was once part of searchCondition, however, searchcondition() also immediately adds the search condition.
Redefined in descendants as:
Dummy method to prevent loading/storing of data.
API Tags:
Redefinition of:
- atkAttribute::getSearchModes()
- Retrieve the list of searchmodes supported by the attribute.
Redefined in descendants as:
Dummy method to prevent loading/storing of data.
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:
Dummy method to prevent loading/storing of data.
Redefined in descendants as:
Dummy method to prevent loading/storing of data.
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:
Dummy method to prevent loading/storing of data.
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.
Redefined in descendants as:
void setDestinationFilter(
String
$filter
)
|
|
Sets the destination filter.
Parameters:
|
String |
$filter: |
The destination filter. |
boolean store(
atkDb
$db, array
$rec, string
$mode
)
|
|
Override the store method of this attribute to search
Parameters:
|
atkDb |
$db: |
|
|
array |
$rec: |
The record |
|
string |
$mode: |
|
Redefined in descendants as:
void validate(
&$rec, String
$mode, array
$rec
)
|
|
Checks if a value is valid.
Note that obligatory and unique fields are checked by the atkNodeValidator, and not by the validate() method itself.
Parameters:
|
array |
$rec: |
The record that holds the value for this attribute. If an error occurs, the error will be stored in the 'atkerror' field of the record. |
|
String |
$mode: |
The mode for which should be validated ("add" or "update") |
|
|
&$rec: |
|
Redefinition of:
- atkAttribute::validate()
- Checks if a value is valid.
Redefined in descendants as: