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


PHP Search::addKeywords方法代碼示例

本文整理匯總了PHP中Search::addKeywords方法的典型用法代碼示例。如果您正苦於以下問題:PHP Search::addKeywords方法的具體用法?PHP Search::addKeywords怎麽用?PHP Search::addKeywords使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Search的用法示例。


在下文中一共展示了Search::addKeywords方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: save

 public function save($key_id)
 {
     $db = new PHPWS_DB('ps_text');
     $result = $db->saveObject($this);
     if (PHPWS_Error::isError($result)) {
         return $result;
     }
     $search = new Search($key_id);
     $search->addKeywords($this->content);
     return $search->save();
 }
開發者ID:HaldunA,項目名稱:phpwebsite,代碼行數:11,代碼來源:PS_Text.php

示例2: save

 public function save()
 {
     PHPWS_Core::initModClass('search', 'Search.php');
     if (!$this->id) {
         $new = true;
         $this->create_date = time();
     } else {
         $new = false;
     }
     $this->last_updated = time();
     // If this page has a parent and the order is not set
     // then increment
     if (!$this->page_order && $this->parent_page) {
         $page_order = $this->getLastPage();
         if (!PHPWS_Error::logIfError($page_order)) {
             $this->page_order = $page_order + 1;
         } else {
             $this->page_order = 1;
         }
     }
     $db = new PHPWS_DB('ps_page');
     if (PHPWS_Error::logIfError($db->saveObject($this))) {
         return false;
     }
     $this->saveKey();
     if ($new && Current_User::isRestricted('pagesmith')) {
         Current_User::giveItemPermission($this->_key);
     }
     $search = new Search($this->key_id);
     $search->resetKeywords();
     $search->addKeywords($this->title);
     PHPWS_Error::logIfError($search->save());
     foreach ($this->_sections as $section) {
         $section->pid = $this->id;
         PHPWS_Error::logIfError($section->save($this->key_id));
     }
     PHPWS_Cache::remove($this->cacheKey());
 }
開發者ID:sysulsj,項目名稱:phpwebsite,代碼行數:38,代碼來源:PS_Page.php

示例3: pagesmithSearchIndex

/**
 * Versions prior to 1.1.0 didn't have search. This function
 * plugs in values for all current text sections.
 */
function pagesmithSearchIndex()
{
    PHPWS_Core::initModClass('search', 'Search.php');
    $db = new PHPWS_DB('ps_text');
    $db->addColumn('id');
    $db->addColumn('content');
    $db->addColumn('ps_page.key_id');
    $db->addColumn('ps_page.title');
    $db->addWhere('ps_text.pid', 'ps_page.id');
    $db->addOrder('pid');
    $db->addOrder('secname');
    $result = $db->select();
    if (!empty($result)) {
        if (PHPWS_Error::logIfError($result)) {
            return false;
        }
        foreach ($result as $pg) {
            $search = new Search($pg['key_id']);
            $search->addKeywords($pg['content']);
            $search->addKeywords($pg['title']);
            PHPWS_Error::logIfError($search->save());
        }
    }
    return true;
}
開發者ID:sysulsj,項目名稱:phpwebsite,代碼行數:29,代碼來源:update.php

示例4: save

 function save($save_key = TRUE)
 {
     $db = new PHPWS_DB('wiki_pages');
     $result = $db->saveObject($this);
     if (PEAR::isError($result)) {
         return $result;
     }
     if ($save_key) {
         $result = $this->saveKey();
         if (PEAR::isError($result)) {
             return $result;
         }
         $search = new Search($this->key_id);
         $search->resetKeywords();
         $search->addKeywords($this->title);
         $search->addKeywords($this->pagetext);
         $search->save();
     }
 }
開發者ID:Jopperi,項目名稱:wiki,代碼行數:19,代碼來源:WikiPage.php

示例5: addKeyword

 public static function addKeyword($keyword, $key_id)
 {
     $search = new Search((int) $key_id);
     if ($search->_error) {
         PHPWS_Error::log($search->_error);
         return;
     }
     $search->addKeywords($keyword, FALSE);
     return $search->save();
 }
開發者ID:HaldunA,項目名稱:phpwebsite,代碼行數:10,代碼來源:Admin.php

示例6: save

 public function save()
 {
     PHPWS_Core::initModClass('search', 'Search.php');
     $table = $this->_schedule->getEventTable();
     if (!PHPWS_DB::isTable($table)) {
         return PHPWS_Error::get(CAL_EVENT_TABLE_MISSING, 'calendar', 'Calendar_Event::save');
     }
     $db = new PHPWS_DB($table);
     $result = $db->saveObject($this);
     if (PHPWS_Error::isError($result)) {
         return $result;
     } elseif (!$this->pid) {
         // only save the key if the pid is 0
         // ie source event not copy
         if (empty($this->key_id)) {
             $save_key = true;
         } else {
             $save_key = false;
         }
         $key = $this->saveKey();
         if (PHPWS_Error::isError($key)) {
             PHPWS_Error::log($key);
             return false;
         }
         if ($save_key) {
             $db->saveObject($this);
         }
         /* save search settings */
         $search = new Search($this->key_id);
         $search->addKeywords($this->summary);
         $search->addKeywords($this->location);
         $search->addKeywords($this->description);
         $search->save();
         return true;
     }
 }
開發者ID:HaldunA,項目名稱:phpwebsite,代碼行數:36,代碼來源:Event.php

示例7: save

 public function save()
 {
     $db = new PHPWS_DB('blog_entries');
     if (empty($this->id)) {
         $this->create_date = time();
         if (!$this->publish_date) {
             $this->publish_date = $this->create_date;
         }
         if (Current_User::isLogged()) {
             $this->author_id = Current_User::getId();
             $this->author = Current_User::getDisplayName();
         } elseif (empty($this->author)) {
             $this->author_id = 0;
             $this->author = dgettext('blog', 'Anonymous');
         }
     }
     if (Current_User::isLogged()) {
         $this->updater_id = Current_User::getId();
         $this->updater = Current_User::getDisplayName();
     } elseif (empty($this->updater)) {
         $this->updater_id = 0;
         $this->updater = dgettext('blog', 'Anonymous');
     }
     $this->update_date = time();
     if (empty($this->entry)) {
         $this->entry = '';
     }
     $result = $db->saveObject($this);
     if (PHPWS_Error::isError($result)) {
         return $result;
     }
     $update = !$this->key_id ? true : false;
     $this->saveKey();
     if ($update) {
         $db->saveObject($this);
     }
     $search = new Search($this->key_id);
     $search->resetKeywords();
     $search->addKeywords($this->title);
     $search->addKeywords($this->summary);
     $search->addKeywords($this->entry);
     $result = $search->save();
     if (PHPWS_Error::isError($result)) {
         return $result;
     }
     return $this->id;
 }
開發者ID:HaldunA,項目名稱:phpwebsite,代碼行數:47,代碼來源:Blog.php


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