本文整理汇总了PHP中RGForms::init方法的典型用法代码示例。如果您正苦于以下问题:PHP RGForms::init方法的具体用法?PHP RGForms::init怎么用?PHP RGForms::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RGForms
的用法示例。
在下文中一共展示了RGForms::init方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: detachFormEntry
public function detachFormEntry($lead_id)
{
$entries = $this->getFormEntryIds();
Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Start to detach gravity forms: " . print_r($entries, true));
if (in_array($lead_id, $entries)) {
Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Lead id is in the list of entries: " . $lead_id);
if (class_exists('RGForms')) {
if (!class_exists('RGFormsModel')) {
RGForms::init();
}
if (class_exists('RGFormsModel')) {
global $wpdb;
$lead_table = RGFormsModel::get_lead_table_name();
$lead_notes_table = RGFormsModel::get_lead_notes_table_name();
$lead_detail_table = RGFormsModel::get_lead_details_table_name();
$lead_detail_long_table = RGFormsModel::get_lead_details_long_table_name();
//Delete from detail long
$sql = $wpdb->prepare(" DELETE FROM {$lead_detail_long_table}\n WHERE lead_detail_id IN(\n SELECT id FROM {$lead_detail_table} WHERE lead_id=%d\n )", $lead_id);
$wpdb->query($sql);
//Delete from lead details
$sql = $wpdb->prepare("DELETE FROM {$lead_detail_table} WHERE lead_id=%d", $lead_id);
$wpdb->query($sql);
//Delete from lead notes
$sql = $wpdb->prepare("DELETE FROM {$lead_notes_table} WHERE lead_id=%d", $lead_id);
$wpdb->query($sql);
//Delete from lead
$sql = $wpdb->prepare("DELETE FROM {$lead_table} WHERE id=%d", $lead_id);
$wpdb->query($sql);
// Remove entry from array
$entries = array_values(array_diff($entries, array($lead_id)));
$this->_formEntryIds = $entries;
$qty = $this->getQuantity();
$this->setQuantity($qty - 1);
}
}
}
}