The AMI_Filter class
• Introduction
Module component item list filter model.
• Class synopsis
// Array of dropped fields
// Returns filter field value.
public
static
getFieldValue ( string $name, [ mixed $default = null ] ) returns mixed;
// Adds view field.
// Drops view fields.
// Returns item id.
public
getId ( ) returns mixed;
// Returns module Id.
// Sets module Id.
public
setModId ( string $modId ) returns void;
// For custom data manipulation.
}
• Class Properies
-
protected
array
$aDroppedFields
-
Array of dropped fields
• Class Methods
// Returns filter field value.
public
static
getFieldValue ( string $name, [ mixed $default = null ] ) returns mixed;
-
string $name
Field name
-
mixed $default
Default value to return
-
array $aField
Field structure
Example: // Add text field
array(
// Filter field name
'name' => 'nickname',
// Text input field {
'type' => 'input',
'flt_type' => 'text',
// } Text input field
// Default field value
'flt_default' => '',
// SQL condition, 'like'|'='|'<='|'>="
'flt_condition' => 'like',
// Module table model field name
'flt_column' => 'nickname',
// To filter by dependent model field (joined table field) (since 5.12.8)
'flt_alias' => 'i'
)
);
// Add date/datime filter fields {
// Minimum border
array(
'name' => 'datefrom',
'type' => 'datefrom',
'flt_type' => 'date',
'flt_condition' => '>=',
'flt_column' => 'birth'
)
);
// Maximum border
array(
'name' => 'dateto',
'type' => 'dateto',
'flt_type' => 'date',
'flt_condition' => '<',
'flt_column' => 'birth'
)
);
// } Add date/datime filter fields
// Returns item id.
public
getId ( ) returns mixed;
// Sets module Id.
public
setModId ( string $modId ) returns void;
// For custom data manipulation.
-
string $field
Field name
-
array $aData
Filter data
|