本文整理汇总了PHP中tform_actions::onInsert方法的典型用法代码示例。如果您正苦于以下问题:PHP tform_actions::onInsert方法的具体用法?PHP tform_actions::onInsert怎么用?PHP tform_actions::onInsert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tform_actions
的用法示例。
在下文中一共展示了tform_actions::onInsert方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onInsert
function onInsert()
{
global $app, $conf;
// Check if record is existing already
$duplicate_slave = $app->db->queryOneRecord("SELECT * FROM dns_slave WHERE origin = '" . $app->db->quote($this->dataRecord["origin"]) . "' AND server_id = " . $app->functions->intval($this->dataRecord["server_id"]) . " AND " . $app->tform->getAuthSQL('r'));
if (is_array($duplicate_slave) && !empty($duplicate_slave)) {
$app->error($app->tform->wordbook["origin_error_unique"]);
}
parent::onInsert();
}
示例2: onInsert
function onInsert()
{
global $app, $conf;
// Check if record is existing already
$duplicate_mx = $app->db->queryOneRecord("SELECT * FROM dns_rr WHERE zone = " . $app->functions->intval($this->dataRecord["zone"]) . " AND name = '" . $app->db->quote($this->dataRecord["name"]) . "' AND type = '" . $app->db->quote($this->dataRecord["type"]) . "' AND data = '" . $app->db->quote($this->dataRecord["data"]) . "' AND " . $app->tform->getAuthSQL('r'));
if (is_array($duplicate_mx) && !empty($duplicate_mx)) {
$app->error($app->tform->wordbook["duplicate_mx_record_txt"]);
}
parent::onInsert();
}