本文整理匯總了PHP中AllPermissionsOptimizationUtil::groupBeingRemovedFromGroup方法的典型用法代碼示例。如果您正苦於以下問題:PHP AllPermissionsOptimizationUtil::groupBeingRemovedFromGroup方法的具體用法?PHP AllPermissionsOptimizationUtil::groupBeingRemovedFromGroup怎麽用?PHP AllPermissionsOptimizationUtil::groupBeingRemovedFromGroup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類AllPermissionsOptimizationUtil
的用法示例。
在下文中一共展示了AllPermissionsOptimizationUtil::groupBeingRemovedFromGroup方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: beforeSave
protected function beforeSave()
{
if (parent::beforeSave()) {
if (isset($this->originalAttributeValues['group']) && $this->originalAttributeValues['group'][1] > 0) {
//copy to new object, so we can populate the old parent group as the related group.
//otherwise it gets passed by reference. We need the old $this->group information to properly
//utilize the groupBeingRemovedFromGroup method.
$group = unserialize(serialize($this));
$group->group = Group::getById($this->originalAttributeValues['group'][1]);
AllPermissionsOptimizationUtil::groupBeingRemovedFromGroup($group);
assert('$this->originalAttributeValues["group"][1] != $this->group->id');
}
return true;
} else {
return false;
}
}