本文整理汇总了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
}
示例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
}
示例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);
});
}
示例4:
/**
* Overloading the constructor for users to make it explicit that
* they don't have owners
*/
function __construct()
{
parent::__construct();
$this->owner = false;
}
示例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();
}
示例6:
function __construct()
{
$this->generateCode();
parent::__construct();
}