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


PHP Role::delete方法代码示例

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


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

示例1: display

 public function display()
 {
     $rolelist = new Template();
     $rolelist->load("role_list");
     $actions = ActionList::get("rolelist");
     if (isset($_POST['insert'])) {
         $role = new Role();
         $role->name = $_POST['insert'];
         $role->insert();
     }
     if (isset($_GET['delete'])) {
         $role = new Role();
         $role->ID = $_GET['delete'];
         $role->delete();
     }
     $table = new Table();
     $id = new TableColumn("id", Language::DirectTranslate("ID"));
     $id->autoWidth = true;
     $name = new TableColumn("name", Language::DirectTranslate("NAME"));
     $table->columns->add($id);
     $table->columns->add($name);
     $table->name = "{'dbprefix'}roles";
     $table->actions = "rolelist";
     $table->orderBy = "name";
     $table->cacheName = "rolelist";
     $rolelist->assign_var("TABLE", $table->getCode());
     $rolelist->output();
 }
开发者ID:srueegger,项目名称:1zu12bB,代码行数:28,代码来源:rolelist.php

示例2: delete

 /**
  * Drop role
  *
  * @param void
  * @return null
  */
 function delete()
 {
     if ($this->active_role->isNew()) {
         $this->httpError(HTTP_ERR_NOT_FOUND);
     }
     // if
     if ($this->request->isSubmitted()) {
         $delete = $this->active_role->delete();
         if ($delete && !is_error($delete)) {
             clean_permissions_cache();
             flash_success("Role ':name' has been deleted", array('name' => $this->active_role->getName()));
         } else {
             flash_error("Failed to delete role ':name'", array('name' => $this->active_role->getName()));
         }
         // if
         $this->redirectTo('admin_roles');
     } else {
         $this->httpError(HTTP_ERR_BAD_REQUEST);
     }
     // if
 }
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:27,代码来源:RolesAdminController.class.php

示例3: delete_role

 /**
  * Delete Role
  * Deletes a role from the database
  * 
  * @param mixed $name
  * @return bool
  */
 public function delete_role($name)
 {
     $r = new Role();
     $r->get_by_name($name);
     if ($r->exists()) {
         return $r->delete();
     }
 }
开发者ID:Moro3,项目名称:duc,代码行数:15,代码来源:Auth_simpleauth.php

示例4: __actionEdit

 public function __actionEdit()
 {
     if (array_key_exists('save', $_POST['action'])) {
         $this->__save(Role::load((int) $this->_context[1]));
     } elseif (array_key_exists('delete', $_POST['action'])) {
         try {
             Role::delete((int) $this->_context[1]);
             redirect(ADMIN_URL . '/extension/aac/roles/');
         } catch (RoleException $e) {
             $this->alerts()->append($e->getMessage(), AlertStack::ERROR, $this->errors);
         } catch (Exception $e) {
             $this->alerts()->append(__('An unknown error has occurred. <a class="more">Show trace information.</a>'), AlertStack::ERROR, $e);
         }
     }
 }
开发者ID:brendo,项目名称:symphony-3,代码行数:15,代码来源:content.roles.php

示例5: deleteRole

 public function deleteRole($id)
 {
     $model = new Role();
     $data = $model->delete($id);
     //$this->deleteRoleGroup($id);
     //$this->deleteRoleFilterResource($id);
 }
开发者ID:knatorski,项目名称:SMS,代码行数:7,代码来源:User.php


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