本文整理汇总了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;
}
}