本文整理匯總了PHP中OCP\IUserManager::listen方法的典型用法代碼示例。如果您正苦於以下問題:PHP IUserManager::listen方法的具體用法?PHP IUserManager::listen怎麽用?PHP IUserManager::listen使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OCP\IUserManager
的用法示例。
在下文中一共展示了IUserManager::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: listen
/**
* @param string $scope
* @param string $method
* @param callable $callback
*/
public function listen($scope, $method, callable $callback)
{
$this->manager->listen($scope, $method, $callback);
}
示例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']);
}