本文整理匯總了PHP中ThemexCore::removeUserRelation方法的典型用法代碼示例。如果您正苦於以下問題:PHP ThemexCore::removeUserRelation方法的具體用法?PHP ThemexCore::removeUserRelation怎麽用?PHP ThemexCore::removeUserRelation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ThemexCore
的用法示例。
在下文中一共展示了ThemexCore::removeUserRelation方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: uncompleteLesson
/**
* Uncompletes lesson
*
* @access public
* @return void
*/
public static function uncompleteLesson()
{
if (!ThemexCore::checkOption('lesson_retake')) {
ThemexCore::removeUserRelation(get_current_user_id(), self::$data['ID'], 'lesson');
if (!empty(self::$data['quiz'])) {
ThemexCore::removeUserRelation(get_current_user_id(), self::$data['quiz']['ID'], 'questions');
ThemexCore::removeUserRelation(get_current_user_id(), self::$data['quiz']['ID'], 'answers');
}
}
}
示例2: deleteUser
/**
* Deletes course member
*
* @access public
* @param int $ID
* @return void
*/
public static function deleteUser($ID)
{
ThemexCore::removeUserRelation($ID, 0, 'plan');
ThemexCore::removeUserRelation($ID, 0, 'course');
ThemexCore::removeUserRelation($ID, 0, 'certificate');
ThemexCore::removeUserRelation($ID, 0, 'lesson');
ThemexCore::removeUserRelation($ID, 0, 'quiz');
}
示例3: removeRelation
/**
* Removes user relation
*
* @access public
* @param int $ID
* @param array $data
* @return void
*/
public static function removeRelation($ID, $data)
{
$relation = themex_value('relation_id', $data);
$type = themex_value('relation_type', $data);
if (in_array($type, array('shop', 'product'))) {
ThemexCore::removeUserRelation($ID, $relation, $type);
if ($type == 'shop') {
$relations = count(ThemexCore::getUserRelations(0, $relation, 'shop'));
ThemexCore::updatePostMeta($relation, 'admirers', $relations);
}
}
die;
}