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


PHP Model\User类代码示例

本文整理汇总了PHP中FOS\UserBundle\Model\User的典型用法代码示例。如果您正苦于以下问题:PHP User类的具体用法?PHP User怎么用?PHP User使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: isGranted

 /**
  * isGranted
  *
  * @param string $grantedRole
  * @param User $user
  * @return bool
  */
 public function isGranted($grantedRole, User $user)
 {
     $grantedRole = new Role($grantedRole);
     if (count($user->getRoles())) {
         foreach ($user->getRoles() as $role) {
             $roles = $this->roleHierarchy->getReachableRoles(array(new Role($role)));
             if (in_array($grantedRole, $roles)) {
                 return true;
             }
         }
     }
     return false;
 }
开发者ID:chadyred,项目名称:intranet,代码行数:20,代码来源:RoleService.php

示例2: __construct

 public function __construct()
 {
     parent::__construct();
     $this->addRole('ROLE_USER');
     $this->autoPassword = false;
     $this->autoUsername = false;
 }
开发者ID:sfraoua,项目名称:fitness-api-oauth,代码行数:7,代码来源:User.php

示例3: setUsername

 public function setUsername($username)
 {
     parent::setUsername($username);
     // El email se configura automáticamente.
     $this->setEmail($username . '@uco.es');
     return $this;
 }
开发者ID:aulasoftwarelibre,项目名称:seta,代码行数:7,代码来源:User.php

示例4: __construct

 /**
  * User constructor.
  */
 public function __construct()
 {
     parent::__construct();
     $this->isActive = true;
     // may not be needed, see section on salt below
     // $this->salt = md5(uniqid(null, true));
 }
开发者ID:m2fd,项目名称:crud-contacts,代码行数:10,代码来源:User.php

示例5: setEmail

 /**
  * Set email
  *
  * @return string
  */
 public function setEmail($email)
 {
     $email = is_null($email) ? '' : $email;
     parent::setEmail($email);
     $this->setUsername($email);
     return $this;
 }
开发者ID:nfqakademija,项目名称:cooFood,代码行数:12,代码来源:User.php

示例6: __construct

 public function __construct()
 {
     parent::__construct();
     $this->requests = new ArrayCollection();
     $this->experience = 0;
     $this->newOauth = false;
 }
开发者ID:NeonXP,项目名称:NightQuest,代码行数:7,代码来源:User.php

示例7: __construct

 public function __construct()
 {
     parent::__construct();
     // your own logic
     $this->commandes = new \Doctrine\Common\Collections\ArrayCollection();
     $this->adresses = new \Doctrine\Common\Collections\ArrayCollection();
 }
开发者ID:nassafou,项目名称:ecomApp,代码行数:7,代码来源:Utilisateurs.php

示例8: __construct

 public function __construct()
 {
     parent::__construct();
     // your own logic
     $this->usuario_adopciones = new ArrayCollection();
     $this->usuario_archivos = new ArrayCollection();
 }
开发者ID:Checo1983,项目名称:petfriends,代码行数:7,代码来源:User.php

示例9: __construct

 public function __construct()
 {
     parent::__construct();
     $this->postsCreated = new ArrayCollection();
     $this->tagsCreated = new ArrayCollection();
     // your own logic
 }
开发者ID:JaronKing,项目名称:BlogApplication,代码行数:7,代码来源:User.php

示例10: __construct

 public function __construct()
 {
     parent::__construct();
     $this->folders = new ArrayCollection();
     $this->events = new ArrayCollection();
     $this->enabled = 0;
 }
开发者ID:Marquand,项目名称:support,代码行数:7,代码来源:User.php

示例11: __construct

 public function __construct($class)
 {
     parent::__construct($class);
     //$now = new \Datetime();
     //$this->created = $now;
     //$this->updated = $now;
 }
开发者ID:Anaroyondo,项目名称:Prescrinet,代码行数:7,代码来源:Utilisateur.php

示例12: __construct

 public function __construct()
 {
     parent::__construct();
     $this->address = new \Doctrine\Common\Collections\ArrayCollection();
     $this->orders = new \Doctrine\Common\Collections\ArrayCollection();
     $this->userImg = new \Doctrine\Common\Collections\ArrayCollection();
 }
开发者ID:nicks78,项目名称:MyFirst,代码行数:7,代码来源:Users.php

示例13: __construct

 public function __construct()
 {
     parent::__construct();
     $this->forumQuestions = new ArrayCollection();
     $this->forumAnswers = new ArrayCollection();
     $this->lots = new ArrayCollection();
 }
开发者ID:bhdm,项目名称:bankrotOld,代码行数:7,代码来源:User.php

示例14: __construct

 public function __construct()
 {
     parent::__construct();
     $this->files = new ArrayCollection();
     $this->directories = new ArrayCollection();
     $this->playlists = new ArrayCollection();
 }
开发者ID:riki343,项目名称:MyPrivateDesktop,代码行数:7,代码来源:User.php

示例15: __construct

 public function __construct()
 {
     $this->artigos = new ArrayCollection();
     $this->mensagens = new ArrayCollection();
     $this->topicos = new ArrayCollection();
     parent::__construct();
 }
开发者ID:brunowerneck,项目名称:php-br,代码行数:7,代码来源:User.php


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