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


PHP Person::getRoles方法代码示例

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


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

示例1: userSettings

 /**
  * Administrator can view settings of a certain user
  *
  * @param integer $userId
  * @param Request $request
  *
  * @return
  */
 public function userSettings($userId, Request $request)
 {
     if (empty($request->user()) || !$request->user()->hasRole('administrator')) {
         return redirect('/');
     }
     $user = $this->users->getById($userId);
     if (empty($user)) {
         abort(404);
     }
     // The person to view the profile of
     $person = new Person();
     $person->setNode($user);
     $fullUser = $user->getProperties();
     unset($fullUser['created_at']);
     unset($fullUser['MEDEA_UUID']);
     unset($fullUser['password']);
     unset($fullUser['remember_token']);
     unset($fullUser['token']);
     unset($fullUser['updated_at']);
     unset($fullUser['verified']);
     $fullUser['id'] = $userId;
     return view('pages.settings', ['accessLevels' => $this->getProfileAccessLevels(), 'roles' => $person->getRoles(), 'user' => $fullUser]);
 }
开发者ID:weopendata,项目名称:medea,代码行数:31,代码来源:UserController.php

示例2: sendRegistrationToAdmin

 /**
  * Deliver a registration email to the admin
  *
  * @param Person $user
  * @return void
  */
 public function sendRegistrationToAdmin(Person $user)
 {
     $this->to = env('ADMIN_EMAIL');
     $this->view = 'auth.emails.adminconfirm';
     $roles_string = '';
     foreach ($user->getRoles() as $role) {
         $roles_string .= $role . ',';
     }
     $roles_string = rtrim($roles_string, ',');
     $this->data = ['user' => $user, 'roles' => $roles_string];
     $this->subject = 'Nieuwe registratie';
     $this->deliver();
 }
开发者ID:weopendata,项目名称:medea,代码行数:19,代码来源:AppMailer.php

示例3: getAllWithRoles

 /**
  * Get all the bare nodes of a findEvent
  *
  * @param integer $limit
  * @param integer $offset
  *
  * @return array
  */
 public function getAllWithRoles()
 {
     $client = $this->getClient();
     $findLabel = $client->makeLabel($this->label);
     $findNodes = $findLabel->getNodes();
     $data = [];
     foreach ($findNodes as $findNode) {
         $person = new Person();
         $person->setNode($findNode);
         $personData = array_only($findNode->getProperties(), ['firstName', 'lastName', 'verified']);
         $personData['id'] = $findNode->getId();
         $personData['personType'] = $person->getRoles();
         $data[] = $personData;
     }
     return $data;
 }
开发者ID:weopendata,项目名称:medea,代码行数:24,代码来源:UserRepository.php


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