本文整理匯總了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();
}