本文整理汇总了PHP中UserDAO::isUserInDB方法的典型用法代码示例。如果您正苦于以下问题:PHP UserDAO::isUserInDB方法的具体用法?PHP UserDAO::isUserInDB怎么用?PHP UserDAO::isUserInDB使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserDAO
的用法示例。
在下文中一共展示了UserDAO::isUserInDB方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testIsUserInDB
function testIsUserInDB()
{
$conn = $this->db->getConnection();
$udao = new UserDAO($this->logger, $this->db);
$this->assertTrue($udao->isUserInDB(930061));
$this->assertTrue(!$udao->isUserInDB(9.345465465465006E+16));
$this->db->closeConnection($conn);
}
示例2: array
$owner = $od->getByEmail($_SESSION['user']);
$i = $id->getByUserId($fb_user);
if (isset($i)) {
echo "Instance exists<br />";
$oi = $oid->get($owner->id, $i->id);
if ($oi == null) {
//Instance already exists, owner instance doesn't
$oid->insert($owner->id, $i->id, $session_key);
//Add owner instance with session key
echo "Created owner instance.<br />";
}
} else {
//Instance does not exist
echo "Instance does not exist<br />";
$id->insert($fb_user, $fb_username, 'facebook');
echo "Created instance";
$i = $id->getByUserId($fb_user);
$oid->insert($owner->id, $i->id, $session_key);
echo "Created owner instance.<br />";
}
if (!$ud->isUserInDB($fb_user)) {
$r = array('user_id' => $fb_user, 'user_name' => $fb_username, 'full_name' => $fb_username, 'avatar' => '', 'location' => '', 'description' => '', 'url' => '', 'is_protected' => '', 'follower_count' => 0, 'friend_count' => 0, 'post_count' => 0, 'last_updated' => '', 'last_post' => '', 'joined' => '', 'last_post_id' => '', 'network' => 'facebook');
$u = new User($r, 'Owner info');
$ud->updateUser($u);
}
} else {
echo "No session key or logged in Facebook user.";
}
# clean up
$db->closeConnection($conn);
echo '<br /> <a href="' . $THINKTANK_CFG['site_root_path'] . 'account/">Back to your account</a>.';
示例3: testIsUserInDB
function testIsUserInDB()
{
$udao = new UserDAO($this->db, $this->logger);
$this->assertTrue($udao->isUserInDB(12));
$this->assertTrue(!$udao->isUserInDB(13));
}