示例#1
0
 /**
  * @param $wikiId
  * @param int $userId
  * @param null|string $uploadDate
  * @param null|int $pageCount
  * @return GWTWiki
  * @throws GWTException
  */
 public function insert($wikiId, $userId = 0, $uploadDate = null, $pageCount = null)
 {
     if (!$this->databaseConnection->insert("webmaster_sitemaps", array("wiki_id" => $wikiId, "user_id" => $userId, "upload_date" => $uploadDate, "page_count" => $pageCount))) {
         throw new GWTException("can't insert wiki id = " . $wikiId);
     }
     return new GWTWiki($wikiId, $userId, $uploadDate, $pageCount);
 }
示例#2
0
 /**
  * @param $username
  * @param $password
  * @return GWTUser
  * @throws Exception
  */
 public function insert($username, $password)
 {
     $user_id = $this->generateUserId();
     if (!$this->databaseConnection->insert("webmaster_user_accounts", array("user_id" => $user_id, "user_name" => $username, "user_password" => $password, "wikis_number" => 0))) {
         throw new Exception("can't insert user id = " . $user_id . " name = " . $username);
     }
     return new GWTUser($user_id, $username, $password, 0);
 }