本文整理汇总了PHP中Token::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Token::getAll方法的具体用法?PHP Token::getAll怎么用?PHP Token::getAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Token
的用法示例。
在下文中一共展示了Token::getAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: find
static function find($search_id)
{
$found_token = null;
$all_tokens = Token::getAll();
foreach ($all_tokens as $token) {
if ($token->getId() == $search_id) {
$found_token = $token;
}
}
return $found_token;
}
示例2: testDelete
function testDelete()
{
$patron_id = 1;
$menu_id = 2;
$sender_id = 3;
$test_token = new Token($patron_id, $menu_id, $sender_id);
$test_token->save();
$patron_id2 = 4;
$menu_id2 = 5;
$sender_id2 = 6;
$test_token2 = new Token($patron_id2, $menu_id2, $sender_id2);
$test_token2->save();
$test_token->delete();
$result = Token::getAll();
$this->assertEquals([$test_token2], $result);
}
示例3: spl_autoload_register
<?php
require 'config.php';
//Configuration
require 'HTTP/Request2.php';
/* Autoloading class.php **/
spl_autoload_register(function ($class) {
include 'lib/' . strtolower($class) . '.php';
});
$tokens = Token::getAll();
foreach ($tokens as $row) {
echo $row['service'] . '::' . $row['userid'] . "\n";
$className = ucfirst($row['service']);
$className::update($row['userid']);
if ($row['service'] == 'github') {
//perform a gitscore update as well
//since we don't store a token for it
Gitscore::update($row['userid']);
echo 'gitscore::' . $row['userid'] . "\n";
}
}