當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UserDAO::isUserInDB方法代碼示例

本文整理匯總了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);
 }
開發者ID:nickthornley,項目名稱:thinktank,代碼行數:8,代碼來源:userdao_test.php

示例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>.';
開發者ID:ukd1,項目名稱:thinktank,代碼行數:31,代碼來源:fbsavesession.php

示例3: testIsUserInDB

 function testIsUserInDB()
 {
     $udao = new UserDAO($this->db, $this->logger);
     $this->assertTrue($udao->isUserInDB(12));
     $this->assertTrue(!$udao->isUserInDB(13));
 }
開發者ID:BenBtg,項目名稱:thinktank,代碼行數:6,代碼來源:userdao_test.php


注:本文中的UserDAO::isUserInDB方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。