本文整理汇总了PHP中ExtensionManager::getExtensionsIncludingCore方法的典型用法代码示例。如果您正苦于以下问题:PHP ExtensionManager::getExtensionsIncludingCore方法的具体用法?PHP ExtensionManager::getExtensionsIncludingCore怎么用?PHP ExtensionManager::getExtensionsIncludingCore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExtensionManager
的用法示例。
在下文中一共展示了ExtensionManager::getExtensionsIncludingCore方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(\ExtensionManager $extensionManager, UserAccountModel $user)
{
foreach ($extensionManager->getExtensionsIncludingCore() as $extension) {
$extID = $extension->getId();
foreach ($extension->getUserNotificationPreferenceTypes() as $type) {
$key = str_replace(".", "_", $extID . '.' . $type);
$this->preferences[$key] = $extension->getUserNotificationPreference($type);
}
}
$this->user = $user;
}
示例2: array
function __construct(ExtensionManager $extensionManager, $permissions, \models\UserAccountModel $userAccountModel = null, $removeEditorPermissions = false, $includeChildrenPermissions = false)
{
if ($userAccountModel) {
$this->has_user = true;
$this->has_user_editor = $userAccountModel->getIsEditor();
$this->has_user_verified = $userAccountModel->getIsEmailVerified();
$this->has_user_system_administrator = $userAccountModel->getIsSystemAdmin();
}
$this->removeEditorPermissions = $removeEditorPermissions;
$this->permissions = array();
// Add direct permissions, checking user stats as we do so.
foreach ($permissions as $permission) {
$this->addPermission($permission);
}
// now add children
if ($includeChildrenPermissions) {
$loopCount = 0;
do {
$loopCount++;
$addedAny = false;
foreach ($extensionManager->getExtensionsIncludingCore() as $extension) {
foreach ($extension->getUserPermissions() as $possibleChildID) {
$possibleChildPermission = $extension->getUserPermission($possibleChildID);
if (!$this->hasPermission($extension->getId(), $possibleChildID)) {
$addThisOne = false;
foreach ($possibleChildPermission->getParentPermissionsIDs() as $parentData) {
if (!$addThisOne && $this->hasPermission($parentData[0], $parentData[1])) {
$addThisOne = true;
}
}
if ($addThisOne) {
$this->addPermission($possibleChildPermission);
$addedAny = true;
}
}
}
}
} while ($addedAny && $loopCount < 100);
}
}