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


PHP Entity::__construct方法代码示例

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


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

示例1: hash

 function __construct()
 {
     parent::__construct();
     $this->code = hash('sha256', mt_rand() . microtime(true));
     $this->expires = strtotime('now + 10 minutes');
     $this->setTitle($this->code);
     // better stub generation, not that it matters
 }
开发者ID:kylewm,项目名称:KnownOAuth2,代码行数:8,代码来源:Code.php

示例2: hash

 function __construct($token_type = 'grant', $expires_in = 2419200)
 {
     parent::__construct();
     $this->access_token = hash('sha256', mt_rand() . microtime(true));
     $this->refresh_token = hash('sha256', mt_rand() . microtime(true));
     $this->expires_in = $expires_in;
     // Default expires is 1 month, like facebook
     $this->token_type = $token_type;
     $this->setTitle($this->access_token);
     // better stub generation, not that it matters
 }
开发者ID:kylewm,项目名称:KnownOAuth2,代码行数:11,代码来源:Token.php

示例3: function

 /**
  * Overloading the constructor for users to make it explicit that
  * they don't have owners
  */
 function __construct()
 {
     parent::__construct();
     $this->owner = false;
     // Hook to add user data to webfinger
     \Idno\Core\site()->addEventHook('webfinger', function (\Idno\Core\Event $event) {
         $user = $event->data()['object'];
         $links = $event->response();
         if (empty($links)) {
             $links = array();
         }
         if ($user instanceof User) {
             $links = array(array('rel' => 'http://webfinger.net/rel/avatar', 'href' => $user->getIcon()), array('rel' => 'http://webfinger.net/rel/profile-page', 'href' => $user->getURL()));
         }
         $event->setResponse($links);
     });
 }
开发者ID:phpsource,项目名称:idno,代码行数:21,代码来源:User.php

示例4:

 /**
  * Overloading the constructor for users to make it explicit that
  * they don't have owners
  */
 function __construct()
 {
     parent::__construct();
     $this->owner = false;
 }
开发者ID:smartboyathome,项目名称:Known,代码行数:9,代码来源:User.php

示例5: array

 /**
  * On initial creation, make sure access groups have a members property
  * @return mixed
  */
 function __construct()
 {
     $this->members = array('read' => array(\Idno\Core\site()->session()->currentUser()->getUUID()), 'write' => array(\Idno\Core\site()->session()->currentUser()->getUUID()), 'admin' => array(\Idno\Core\site()->session()->currentUser()->getUUID()));
     return parent::__construct();
 }
开发者ID:hank,项目名称:Known,代码行数:9,代码来源:AccessGroup.php

示例6:

 function __construct()
 {
     $this->generateCode();
     parent::__construct();
 }
开发者ID:emory,项目名称:Known,代码行数:5,代码来源:Invitation.php


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