本文整理汇总了PHP中Get::filter方法的典型用法代码示例。如果您正苦于以下问题:PHP Get::filter方法的具体用法?PHP Get::filter怎么用?PHP Get::filter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Get
的用法示例。
在下文中一共展示了Get::filter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save_connection
/**
* save a new connection or update an old connection
* @param string $old_name
* @param DoceboConnector $connection
**/
function save_connection($old_name, $connection)
{
// $name = Docebo::db()->escape($connection->get_name());
// $description = Docebo::db()->escape($connection->get_description());
$name = $connection->get_name();
$description = $connection->get_description();
$type = Get::filter($connection->get_type_name(), DOTY_ALPHANUM);
$params = $connection->get_config();
$str_params = urlencode(serialize($params));
$lang =& $this->get_lang();
if (strlen(trim($name)) == 0) {
$this->last_error = $lang->def('_OPERATION_FAILURE');
return FALSE;
}
if ($old_name === '') {
$query = "INSERT INTO " . $GLOBALS['prefix_fw'] . "_connection" . "(name,description,type,params)" . " VALUES " . "('{$name}','{$description}','{$type}','{$str_params}')";
} else {
$query = "UPDATE " . $GLOBALS['prefix_fw'] . "_connection SET" . " name = '" . $name . "'," . " description = '" . $description . "'," . " type = '{$type}'," . " params = '{$str_params}' " . " WHERE name = '" . $old_name . "'";
}
//echo $query; die();
if (sql_query($query)) {
return TRUE;
} else {
$this->last_error = mysql_error();
return FALSE;
}
}