当前位置: 首页>>代码示例>>PHP>>正文


PHP Permissions::findAll方法代码示例

本文整理汇总了PHP中Permissions::findAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Permissions::findAll方法的具体用法?PHP Permissions::findAll怎么用?PHP Permissions::findAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Permissions的用法示例。


在下文中一共展示了Permissions::findAll方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getPermissionsBySource

 static function getPermissionsBySource()
 {
     $sources = array();
     $permissions = Permissions::findAll();
     //findAll
     if (is_array($permissions)) {
         foreach ($permissions as $permission) {
             if (!isset($sources[$permission->getSource()])) {
                 $sources[$permission->getSource()] = array();
             }
             // if
             $sources[$permission->getSource()][] = array($permission->getName(), $permission->getId());
         }
         // foreach
     }
     // if
     return $sources;
 }
开发者ID:bklein01,项目名称:Project-Pier,代码行数:18,代码来源:Permissions.class.php

示例2: removeSource

 static function removeSource($source)
 {
     $permissions = Permissions::findAll(array('conditions' => "`source` = '" . $source . "'"));
     if (is_array($permissions)) {
         foreach ($permissions as $permission) {
             $userpermissions = ProjectUserPermissions::findAll(array('conditions' => "`permission_id` = '" . $permission->getId() . "'"));
             foreach ($userpermissions as $userpermission) {
                 $userpermission->delete();
             }
             $permission->delete();
         }
         return true;
         // permission already exists
     }
     return false;
     // permission source does not exist
 }
开发者ID:469306621,项目名称:Languages,代码行数:17,代码来源:PermissionManager.class.php

示例3: removeSource

 static function removeSource($source)
 {
     $permissions = Permissions::findAll(array('conditions' => "`source` = '" . $source . "'"));
     if (is_array($permissions)) {
         foreach ($permissions as $permission) {
             PermissionManager::removeUserPermissions($permission);
             $permission->delete();
         }
         return true;
         // permission source removed
     }
     return false;
     // permission source does not exist
 }
开发者ID:federosky,项目名称:ProjectPier-Core,代码行数:14,代码来源:PermissionManager.class.php

示例4: lang

<?php

$page_title = lang('permissions');
set_page_title($page_title);
project_crumbs(lang('permissions'));
add_stylesheet_to_page('project/permissions.css');
$source = array();
$names = array();
$source_id = 0;
$name_id = 0;
$xpermissions = Permissions::findAll();
// findAll
if (is_array($permissions)) {
    foreach ($xpermissions as $permission) {
        $source_id++;
        $sources[$permission->getSource()] = option_tag($permission->getSource(), $source_id);
        $name_id++;
        $names[$permission->getName()] = option_tag($permission->getName(), $name_id);
    }
    // foreach
}
// if
$this->includeTemplate(get_template_path('project/pageactions'));
$quoted_permissions = array();
foreach ($permissions as $permission_id => $permission_text) {
    $quoted_permissions[] = "'{$permission_id}'";
}
// foreach
if (isset($companies) && is_array($companies) && count($companies)) {
    ?>
<form action="<?php 
开发者ID:bklein01,项目名称:Project-Pier,代码行数:31,代码来源:permissions.php


注:本文中的Permissions::findAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。