• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Entity\User类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: setEmail

 /**
  * Set email and, if there is no username set, set the email as username
  * @param string $email
  * @return $this|\FOS\UserBundle\Model\UserInterface
  */
 public function setEmail($email)
 {
     if (!$this->username) {
         $this->username = $email;
     }
     return parent::setEmail($email);
 }
开发者ID:avanthay,项目名称:timekipr,代码行数:12,代码来源:User.php


示例2: __construct

 public function __construct()
 {
     parent::__construct();
     /* @var $doctrine \Doctrine\Bundle\DoctrineBundle\Registry */
     $doctrine = \AppKernel::getStaticContainer()->get('doctrine');
     /* @var $em \Doctrine\ORM\EntityManager */
     $em = $doctrine->getManager();
     $this->setEnabled(true);
     $group = $em->getRepository('ApplicationSonataUserBundle:Group')->find(static::GroupId);
     if ($group) {
         $this->addGroup($group);
     }
 }
开发者ID:defan-marunchak,项目名称:eurotax,代码行数:13,代码来源:User.php


示例3: __construct

 /**
  * User constructor.
  */
 public function __construct()
 {
     // Construct parent
     parent::__construct();
     // Set communications as an array
     $this->viewedCommunications = new ArrayCollection();
     // Set default user role
     if (empty($this->roles)) {
         $this->roles = Globals::getDefaultRoles();
     }
     // Set dafault user language
     if (empty($this->language)) {
         $this->language = Globals::getDefaultLanguage();
     }
 }
开发者ID:spirit-dev,项目名称:dbox-user,代码行数:18,代码来源:User.php


示例4: setEmail

 /**
  * override original setter, with set username with email.
  *
  * {@inheritDoc}
  *
  * @see \FOS\UserBundle\Model\User::setEmail()
  */
 public function setEmail($email)
 {
     parent::setEmail($email);
     $this->setUsername($email);
     return $this;
 }
开发者ID:extdevelopment,项目名称:login-task,代码行数:13,代码来源:User.php


示例5: buildForm

 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     /** @var \Wealthbot\RiaBundle\Entity\RiaCompanyInformation $info */
     $info = $this->user->getRiaCompanyInformation();
     if ($info) {
         $name = $info->getName() ? $info->getName() : $this->user->getProfile()->getCompany();
         $primaryFirstName = $info->getPrimaryFirstName() ? $info->getPrimaryFirstName() : $this->user->getProfile()->getFirstName();
         $primaryLastName = $info->getPrimaryLastName() ? $info->getPrimaryLastName() : $this->user->getProfile()->getLastName();
         $contactEmail = $info->getContactEmail() ? $info->getContactEmail() : $this->user->getEmail();
     } else {
         $name = $this->user->getProfile()->getCompany();
         $primaryFirstName = $this->user->getProfile()->getFirstName();
         $primaryLastName = $this->user->getProfile()->getLastName();
         $contactEmail = $this->user->getEmail();
     }
     $builder->add('name', 'text', array('data' => $name, 'required' => false))->add('slug', 'text', array('required' => true))->add('primary_first_name', 'text', array('data' => $primaryFirstName, 'required' => false))->add('primary_last_name', 'text', array('data' => $primaryLastName, 'required' => false))->add('website', 'url', array('required' => false))->add('address', 'text', array('required' => false))->add('office', 'text', array('required' => false))->add('city', 'text', array('required' => false))->add('state', 'entity', array('class' => 'WealthbotAdminBundle:State', 'label' => 'State', 'empty_value' => 'Select a State', 'required' => false))->add('zipcode', 'text', array('required' => false))->add('phone_number', 'text', array('required' => false))->add('fax_number', 'text', array('required' => false))->add('contact_email', 'email', array('data' => $contactEmail, 'required' => false));
     //Other information
     $builder->add('min_asset_size', 'number', array('precision' => 2, 'grouping' => true, 'required' => false))->add('logo_file', 'file', array('required' => false));
     //Proposal processing
     $builder->add('portfolio_processing', 'choice', array('choices' => RiaCompanyInformation::getPortfolioProcessingChoices(), 'disabled' => true, 'required' => true, 'expanded' => true));
     $this->addValidator($builder);
     if (!$this->isPreSave) {
         $this->addOnBindValidator($builder);
     }
 }
开发者ID:junjinZ,项目名称:wealthbot,代码行数:25,代码来源:RiaCompanyInformationType.php


示例6: getPasswordRequestedAt

 public function getPasswordRequestedAt()
 {
     if (is_null(parent::getPasswordRequestedAt())) {
     } else {
         return date_format(parent::getPasswordRequestedAt(), 'd-m-Y / H:i:s');
     }
 }
开发者ID:steep2000,项目名称:piqua_sym,代码行数:7,代码来源:User.php


示例7: __construct

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


示例8: __construct

 public function __construct()
 {
     parent::__construct();
     $this->setEnabled(true);
     $this->setLocked(false);
     // your own logic
 }
开发者ID:anoopogt,项目名称:BWCMS,代码行数:7,代码来源:UserEntity.php


示例9: __construct

 /**
  * Creates a user
  */
 public function __construct()
 {
     parent::__construct();
     $this->lastLocation = new Location();
     $this->lastLocation->setLatitude(0);
     $this->lastLocation->setLongitude(0);
 }
开发者ID:rjagerman,项目名称:TuneMaps,代码行数:10,代码来源:User.php


示例10: __construct

 public function __construct()
 {
     $this->packages = new ArrayCollection();
     $this->authors = new ArrayCollection();
     $this->createdAt = new \DateTime();
     parent::__construct();
 }
开发者ID:enriquesomolinos,项目名称:packagist,代码行数:7,代码来源:User.php


示例11: __construct

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


示例12: __construct

 public function __construct()
 {
     parent::__construct();
     if (empty($this->roles)) {
         $this->roles[] = 'ROLE_USER';
     }
 }
开发者ID:ancgate,项目名称:ldap_project,代码行数:7,代码来源:User.php


示例13: __construct

 public function __construct()
 {
     parent::__construct();
     $this->created = new \DateTime();
     $this->activated = false;
     $this->enabled = true;
 }
开发者ID:alpixel,项目名称:AlpixelUserBundle,代码行数:7,代码来源:User.php


示例14: __toString

 /**
  * {@inheritdoc}
  */
 public function __toString()
 {
     if (null === $this->getContact()) {
         return parent::__toString();
     }
     return $this->getContact()->__toString();
 }
开发者ID:jlm-entreprise,项目名称:user-bundle,代码行数:10,代码来源:User.php


示例15: __construct

 public function __construct()
 {
     parent::__construct();
     // your own logic
     $this->groups = new \Doctrine\Common\Collections\ArrayCollection();
     $this->projects = new \Doctrine\Common\Collections\ArrayCollection();
     $this->tasks = new \Doctrine\Common\Collections\ArrayCollection();
 }
开发者ID:jarmas8611,项目名称:proyect,代码行数:8,代码来源:User.php


示例16: __construct

 public function __construct()
 {
     parent::__construct();
     $this->created = new \DateTime();
     $this->lastActivity = new \DateTime();
     $this->image = new \Ben\DoctorsBundle\Entity\image();
     $this->consultations = new \Doctrine\Common\Collections\ArrayCollection();
 }
开发者ID:gitter-badger,项目名称:Doctors,代码行数:8,代码来源:User.php


示例17: __construct

 public function __construct()
 {
     parent::__construct();
     $this->friendWithMe = new \Doctrine\Common\Collections\ArrayCollection();
     $this->myFriends = new \Doctrine\Common\Collections\ArrayCollection();
     $this->apiKey = substr(str_shuffle('0123456789AZERTYUIOPQSDFGHJKLMWXCVBNazertyuiopqsdfghjklmwxcvbn'), 32);
     $this->roles = array('ROLE_USER');
 }
开发者ID:makanikki,项目名称:messenger-api,代码行数:8,代码来源:User.php


示例18: __construct

 public function __construct()
 {
     parent::__construct();
     // your own logic
     $this->locked = true;
     $this->applications = new ArrayCollection();
     $this->providers = new ArrayCollection();
 }
开发者ID:nuffer,项目名称:FundraisingDB,代码行数:8,代码来源:Fundraiser.php


示例19: __construct

 public function __construct()
 {
     parent::__construct();
     $this->days = 10;
     $this->alertEmail = false;
     $this->alertDays = 1;
     $this->emailVisible = false;
     $this->homepage = 'Aucune';
 }
开发者ID:bionoir,项目名称:stxcroissants,代码行数:9,代码来源:User.php


示例20: __construct

 public function __construct()
 {
     parent::__construct();
     $this->email = null;
     // note: when saving the user manager will put the email canonical
     // to empty string hence why we removed the unique constraint,
     // to avoid error being thrown when registering a user only with
     // phone number
     $this->emailCanonical = null;
 }
开发者ID:kiddblizzard,项目名称:oauth2-symfony2-vagrant-fosuserbundle,代码行数:10,代码来源:User.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Model\User类代码示例发布时间:2022-05-23
下一篇:
PHP View\View类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap