当前位置: 首页>>代码示例>>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;未经允许,请勿转载。