本文整理汇总了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;
}