本文整理汇总了PHP中OCP\IGroupManager::listen方法的典型用法代码示例。如果您正苦于以下问题:PHP IGroupManager::listen方法的具体用法?PHP IGroupManager::listen怎么用?PHP IGroupManager::listen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OCP\IGroupManager
的用法示例。
在下文中一共展示了IGroupManager::listen方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* @param IUserManager $userManager
* @param IGroupManager $groupManager
* @param IDBConnection $dbConn
*/
public function __construct(IUserManager $userManager, IGroupManager $groupManager, IDBConnection $dbConn)
{
$this->userManager = $userManager;
$this->groupManager = $groupManager;
$this->dbConn = $dbConn;
$this->userManager->listen('\\OC\\User', 'postDelete', function ($user) {
$this->post_deleteUser($user);
});
$this->groupManager->listen('\\OC\\Group', 'postDelete', function ($group) {
$this->post_deleteGroup($group);
});
}
示例2: globalSetup
/**
* To be called from setupFS trough a hook
*
* Sets up listening to changes made to shares owned by the current user
*/
public function globalSetup()
{
$user = $this->userSession->getUser();
if (!$user) {
return;
}
$this->groupManager->listen('\\OC\\Group', 'preAddUser', [$this, 'onPreProcessUser']);
$this->groupManager->listen('\\OC\\Group', 'postAddUser', [$this, 'onPostAddUser']);
$this->groupManager->listen('\\OC\\Group', 'preRemoveUser', [$this, 'onPreProcessUser']);
$this->groupManager->listen('\\OC\\Group', 'postRemoveUser', [$this, 'onPostRemoveUser']);
}
示例3: initListeners
/**
* @param IUserManager $userSession
* @param IGroupManager $groupManager
*/
private function initListeners($userSession, $groupManager)
{
$userSession->listen('\\OC\\User', 'preCreateUser', [$this, 'onPreCreateUser']);
$userSession->listen('\\OC\\User', 'preDelete', [$this, 'onPreDeleteUser']);
$groupManager->listen('\\OC\\Group', 'preCreate', [$this, 'onPreCreateGroup']);
$groupManager->listen('\\OC\\Group', 'preDelete', [$this, 'onPreDeleteGroup']);
}