本文整理汇总了PHP中FOS\UserBundle\Model\User类的典型用法代码示例。如果您正苦于以下问题:PHP User类的具体用法?PHP User怎么用?PHP User使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了User类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
/**
* User constructor.
*/
public function __construct()
{
parent::__construct();
$this->authored_tickets = new ArrayCollection();
$this->assigned_tickets = new ArrayCollection();
$this->workers = new ArrayCollection();
}
开发者ID:xavier-dubreuil,项目名称:ProjectPreview,代码行数:10,代码来源:User.php
示例7: __construct
public function __construct()
{
parent::__construct();
$this->requests = new ArrayCollection();
$this->experience = 0;
$this->newOauth = false;
}
开发者ID:NeonXP,项目名称:NightQuest,代码行数:7,代码来源:User.php
示例8: __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
示例9: __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
示例10: __construct
public function __construct()
{
parent::__construct();
$this->postsCreated = new ArrayCollection();
$this->tagsCreated = new ArrayCollection();
// your own logic
}
开发者ID:JaronKing,项目名称:BlogApplication,代码行数:7,代码来源:User.php
示例11: __construct
public function __construct()
{
parent::__construct();
$this->folders = new ArrayCollection();
$this->events = new ArrayCollection();
$this->enabled = 0;
}
开发者ID:Marquand,项目名称:support,代码行数:7,代码来源:User.php
示例12: __construct
public function __construct($class)
{
parent::__construct($class);
//$now = new \Datetime();
//$this->created = $now;
//$this->updated = $now;
}
开发者ID:Anaroyondo,项目名称:Prescrinet,代码行数:7,代码来源:Utilisateur.php
示例13: __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
示例14: __construct
public function __construct()
{
parent::__construct();
$this->forumQuestions = new ArrayCollection();
$this->forumAnswers = new ArrayCollection();
$this->lots = new ArrayCollection();
}
开发者ID:bhdm,项目名称:bankrotOld,代码行数:7,代码来源:User.php
示例15: __construct
public function __construct()
{
parent::__construct();
$this->files = new ArrayCollection();
$this->directories = new ArrayCollection();
$this->playlists = new ArrayCollection();
}
开发者ID:riki343,项目名称:MyPrivateDesktop,代码行数:7,代码来源:User.php
示例16: __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
示例17: __construct
public function __construct()
{
parent::__construct();
$this->products = new ArrayCollection();
$this->orders = new ArrayCollection();
$this->address = new ArrayCollection();
}
开发者ID:molodoi,项目名称:sfMcommerce,代码行数:7,代码来源:User.php
示例18: __construct
public function __construct()
{
parent::__construct();
$this->groups = new \Doctrine\Common\Collections\ArrayCollection();
$this->courses = new \Doctrine\Common\Collections\ArrayCollection();
$this->payments = new \Doctrine\Common\Collections\ArrayCollection();
}
开发者ID:JavaTrain,项目名称:train,代码行数:7,代码来源:User.php
示例19: __construct
public function __construct()
{
parent::__construct();
// your own logic
$this->passwordExpireAt = new \DateTime('next month');
$this->roles = new ArrayCollection();
}
开发者ID:Varenthein,项目名称:find_bulb,代码行数:7,代码来源:User.php
示例20: __construct
public function __construct()
{
parent::__construct();
// your own logic
$this->blog = new ArrayCollection();
$this->comments = new ArrayCollection();
}
开发者ID:hejoseph,项目名称:blog,代码行数:7,代码来源:Blogger.php
注:本文中的FOS\UserBundle\Model\User类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论