本文整理匯總了PHP中module_controller::samepackage方法的典型用法代碼示例。如果您正苦於以下問題:PHP module_controller::samepackage方法的具體用法?PHP module_controller::samepackage怎麽用?PHP module_controller::samepackage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類module_controller
的用法示例。
在下文中一共展示了module_controller::samepackage方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: ExecuteDeletePackage
static function ExecuteDeletePackage($pk_id_pk, $mpk_id_pk)
{
global $zdbh;
$sql = $zdbh->prepare("SELECT COUNT(*) FROM x_accounts WHERE ac_package_fk=:packageid AND ac_deleted_ts IS NULL");
$sql->bindParam(':packageid', $pk_id_pk);
$sql->execute();
$numrows = $sql->fetchAll();
if ($numrows[0] != 0) {
if ($pk_id_pk == $mpk_id_pk) {
self::$samepackage = true;
return false;
}
}
runtime_hook::Execute('OnBeforeDeletePackage');
$sql = $zdbh->prepare("\n UPDATE x_accounts\n SET ac_package_fk = :mpk_id_pk\n WHERE ac_package_fk =:pk_id_pk");
$sql->bindParam(':mpk_id_pk', $mpk_id_pk);
$sql->bindParam(':pk_id_pk', $pk_id_pk);
$sql->execute();
$sql = $zdbh->prepare("\n UPDATE x_profiles\n SET ud_package_fk = :mpk_id_pk\n WHERE ud_package_fk = :pk_id_pk");
$sql->bindParam(':mpk_id_pk', $mpk_id_pk);
$sql->bindParam(':pk_id_pk', $pk_id_pk);
$sql->execute();
$sql = $zdbh->prepare("\n\t\t\tUPDATE x_packages\n\t\t\tSET pk_deleted_ts = :time\n\t\t\tWHERE pk_id_pk = :pk_id_pk");
$time = time();
$sql->bindParam(':time', $time);
$sql->bindParam(':pk_id_pk', $pk_id_pk);
$sql->execute();
runtime_hook::Execute('OnAfterDeletePackage');
self::$ok = true;
return true;
}