當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。