function XmobileSessionHandler($db, &$controller)
 {
     $this->controller = $controller;
     XoopsTableObjectHandler::XoopsTableObjectHandler($db);
     $this->tableName = $this->db->prefix($this->tableName);
     $this->setSubscriberHandler();
 }
 /**
  * レコードの削除
  * 
  * @param	object  &$record  {@link WordPressUser} object
  * @param	bool	$force		POSTメソッド以外で強制更新する場合はture
  * 
  * @return	bool    成功の時は TRUE
  */
 function delete(&$record, $force = false)
 {
     //ユーザーの削除
     if (!parent::delete($record, $force)) {
         return false;
     }
     //ユーザが投稿した記事及び関連情報の削除
     $criteria =& new Criteria('post_author', $record->getVar('ID'));
     $post_handler =& new WordPressPostHandler($this->db, $this->prefix);
     if (!$post_handler->deleteAll($criteria)) {
         return false;
     }
     //ユーザが作成したリンク情報の削除
     $criteria =& new Criteria('link_owner', $record->getVar('ID'));
     $link_handler =& new WordPressLinkHandler($this->db, $this->prefix);
     if (!$link_handler->deleteAll($criteria)) {
         return false;
     }
     return true;
 }
 /**
  * レコードの削除
  * 
  * @param	object  &$record  {@link WordPressLinkCategory} object
  * @param	bool	$force		POSTメソッド以外で強制更新する場合はture
  * 
  * @return	bool    成功の時は TRUE
  */
 function delete(&$record, $force = false)
 {
     //cat_IDが1のカテゴリは、削除できない
     if ($record->getVar('cat_id') == 1) {
         $this->setError(sprintf(_LANG_WLC_DONOT_DELETE, $record->getVar('cat_name')));
         return false;
     }
     //カテゴリの削除
     if (!parent::delete($record, $force)) {
         return false;
     }
     //削除カテゴリに属するリンクは、Defaultカテゴリに一括変更
     $criteria =& new Criteria('link_category', $record->getVar('cat_id'));
     $link_handler =& new WordPressLinkHandler($this->db, $this->prefix);
     if (!$link_handler->updateAll('link_category', 1, $criteria, $force)) {
         return false;
     }
     return true;
 }
 /**
  * テーブルの条件検索による複数レコード削除
  * 
  * @param	object	$criteria 	{@link XoopsTableObject} 検索条件
  * @param	bool	$force		POSTメソッド以外で強制更新する場合はture
  * 
  * @return	bool    成功の時は TRUE
  */
 function deleteAll($criteria = null, $force = false)
 {
     $GLOBALS['_xoopsTableCache']->clear($this->tableName);
     $this->_fullCached = false;
     return parent::deleteAll($record, $force);
 }
 /**
  * テーブルの条件検索による複数レコード削除
  * 
  * @param	object	$criteria 	{@link CriteriaElement} 検索条件
  * @param	bool	$force		POSTメソッド以外で強制更新する場合はture
  * 
  * @return	bool    成功の時は TRUE
  */
 function &deleteAll($criteria = null, $force = false)
 {
     //条件に合致する記事ID一覧の取得
     $posts =& $this->getObjects($criteria);
     $IDs = array();
     foreach ($posts as $post) {
         $IDs[] = $post->getVar('ID');
     }
     if (!parent::deleteAll($criteria, $id_as_key)) {
         return false;
     }
     if ($IDs) {
         $IDs = "(" . implode(',', $IDs) . ")";
         //記事に対するコメントの削除
         $criteria =& new Criteria('comment_post_ID', $IDs, 'IN');
         $comment_handler =& new WordPressCommentHandler($this->db, $this->prefix, $this->module);
         if (!$comment_handler->deleteAll($criteria, $force)) {
             return false;
         }
         //記事に関連するカテゴリー情報の削除
         $criteria =& new Criteria('post_id', $IDs, 'IN');
         $post2cat_handler =& new WordPressPost2CatHandler($this->db, $this->prefix, $this->module);
         if (!$post2cat_handler->deleteAll($criteria, $force)) {
             return false;
         }
         //記事に関連するメタ情報の削除
         $criteria =& new Criteria('post_id', $IDs, 'IN');
         $postmeta_handler =& new WordPressPostMetaHandler($this->db, $this->prefix, $this->module);
         if (!$postmeta_handler->deleteAll($criteria, $force)) {
             return false;
         }
     }
 }
 function XmobileMyalbumDescHandler($db)
 {
     $pluginName = strtolower(basename(__FILE__, '.php'));
     if (!preg_match("/^\\w+\$/", $pluginName)) {
         trigger_error('Invalid pluginName');
         exit;
     }
     $tableName = $pluginName . '_text';
     XoopsTableObjectHandler::XoopsTableObjectHandler($db);
     $this->tableName = $this->db->prefix($tableName);
 }
 function XmobilePageSessionHandler($db)
 {
     XoopsTableObjectHandler::XoopsTableObjectHandler($db);
     $this->tableName = $this->db->prefix($this->tableName);
 }
 function &getNext(&$resultSet)
 {
     $userObject =& parent::getNext($resultSet);
     if ($userObject) {
         $userObject->syncXoops();
     }
     return $userObject;
 }
 /**
  * テーブルの条件検索による複数レコード取得
  * 
  * @param	object	$criteria 	{@link CriteriaElement} 検索条件
  * @param	bool $id_as_key		プライマリーキーを、戻り配列のキーにする場合はtrue
  * @return	mixed Array			検索結果レコードの配列
  */
 function &getObjects($criteria = null, $id_as_key = false, $fieldlist = "")
 {
     $userObjects =& parent::getObjects($criteria, $id_as_key, $fieldlist);
     for ($i = 0; $i < count($userObjects); $i++) {
         $userObjects[$i]->syncXoops();
     }
     return $userObjects;
 }
 /**
  * レコードの削除
  * 
  * @param	object  &$record  {@link WordPressCategory} object
  * @param	bool	$force		POSTメソッド以外で強制更新する場合はture
  * 
  * @return	bool    成功の時は TRUE
  */
 function delete(&$record, $force = false)
 {
     //cat_IDが1のカテゴリは、削除できない
     if ($record->getVar('cat_ID') == 1) {
         $this->setError(sprintf(_LANG_C_DEFAULT_CAT, $record->getVar('cat_name')));
         return false;
     }
     //カテゴリの削除
     if (!parent::delete($record, $force)) {
         return false;
     }
     //削除カテゴリの子カテゴリは、削除カテゴリの親カテゴリの子カテゴリに変更
     $criteria =& new Criteria('category_parent', $record->getVar('cat_ID'));
     if (!$this->updateAll('category_parent', $record->getVar('category_parent'), $criteria, $force)) {
         return false;
     }
     //削除カテゴリに属する記事は、Defaultカテゴリに一括変更
     $criteria =& new Criteria('category_id', $record->getVar('cat_ID'));
     $post2cat_handler =& new WordPressPost2CatHandler($this->db, $this->prefix);
     if (!$post2cat_handler->updateAll('category_id', 1, $criteria, $force)) {
         return false;
     }
     $this->_cache_by_nicename = array();
     return true;
 }
 function XmobileSubscriberHandler($db)
 {
     XoopsTableObjectHandler::XoopsTableObjectHandler($db);
     $this->tableName = $this->db->prefix($this->tableName);
 }