本文整理匯總了PHP中DataFilter::process方法的典型用法代碼示例。如果您正苦於以下問題:PHP DataFilter::process方法的具體用法?PHP DataFilter::process怎麽用?PHP DataFilter::process使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DataFilter
的用法示例。
在下文中一共展示了DataFilter::process方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: process
function process()
{
$result = parent::process();
switch ($this->_action) {
case "search":
// prepare the WHERE clause
foreach ($this->_fields as $fieldname => $field) {
if ($field->value != "") {
if (strpos($field->name, "_copy") > 0) {
$name = substr($field->db_name, 0, strpos($field->db_name, "_copy"));
} else {
$name = $field->db_name;
}
$field->_getValue();
$field->_getNewValue();
$value = $field->newValue;
switch ($field->clause) {
case "in":
$this->db->where("'{$value}' IN {$name}");
break;
case "likesensitive":
$this->db->where("{$name} LIKE '%{$value}%' COLLATE " . $this->db->char_set . "_bin");
break;
case "likerigth":
$this->db->where("{$name} LIKE '{$value}%'");
break;
case "likeonly":
$this->db->where("{$name} LIKE '{$value}'");
break;
case "likeleft":
$this->db->where("{$name} LIKE '%{$value}'");
break;
//..
}
}
}
$this->_build_buttons();
$this->build_form();
break;
case "reset":
//pulire sessioni
$this->_build_buttons();
$this->build_form();
break;
default:
$this->_build_buttons();
$this->build_form();
break;
}
}