本文整理汇总了PHP中FinderIndexer::remove方法的典型用法代码示例。如果您正苦于以下问题:PHP FinderIndexer::remove方法的具体用法?PHP FinderIndexer::remove怎么用?PHP FinderIndexer::remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FinderIndexer
的用法示例。
在下文中一共展示了FinderIndexer::remove方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteFromCache
/**
* Delete a url from the cache
*
* @since 1.3
* @access public
* @param string
* @return
*/
public function deleteFromCache($id)
{
if (!$this->exists()) {
return;
}
$db = EB::db();
$sql = $db->sql();
$query = array();
$query[] = 'SELECT ' . $db->qn('link_id') . ' FROM ' . $db->qn('#__finder_links');
$query[] = 'WHERE ' . $db->qn('url') . ' LIKE ' . $db->Quote('%option=com_easyblog&view=entry&id=' . $id . '%');
$query = implode(' ', $query);
$db->setQuery($query);
$item = $db->loadResult();
if (EB::isJoomla30()) {
$state = $this->indexer->remove($item);
} else {
$state = FinderIndexer::remove($item);
}
return $state;
}
示例2: remove
/**
* Method to remove an item from the index.
*
* @param string $id The ID of the item to remove.
*
* @return boolean True on success.
*
* @since 2.5
* @throws Exception on database error.
*/
protected function remove($id)
{
// Get the item's URL
$url = $this->db->quote($this->getUrl($id, $this->extension, $this->layout));
// Get the link ids for the content items.
$query = $this->db->getQuery(true)->select($this->db->quoteName('link_id'))->from($this->db->quoteName('#__finder_links'))->where($this->db->quoteName('url') . ' = ' . $url);
$this->db->setQuery($query);
$items = $this->db->loadColumn();
// Check the items.
if (empty($items)) {
return true;
}
// Remove the items.
foreach ($items as $item) {
$this->indexer->remove($item);
}
return true;
}
示例3: remove
/**
* Method to remove an item from the index.
*
* @param string $id The ID of the item to remove.
*
* @return boolean True on success.
*
* @since 2.5
* @throws Exception on database error.
*/
protected function remove($id)
{
JLog::add('FinderIndexerAdapter::remove', JLog::INFO);
// Get the item's URL
$url = $this->db->quote($this->getUrl($id, $this->extension, $this->layout));
// Get the link ids for the content items.
$query = $this->db->getQuery(true);
$query->select($this->db->quoteName('link_id'));
$query->from($this->db->quoteName('#__finder_links'));
$query->where($this->db->quoteName('url') . ' = ' . $url);
$this->db->setQuery($query);
$items = $this->db->loadColumn();
// Check for a database error.
if ($this->db->getErrorNum()) {
// Throw database error exception.
throw new Exception($this->db->getErrorMsg(), 500);
}
// Check the items.
if (empty($items)) {
return true;
}
// Remove the items.
foreach ($items as $item) {
FinderIndexer::remove($item);
}
return true;
}
示例4: onFinderAfterDelete
/**
* Method to remove the link information for items that have been deleted.
*
* @param string $context The context of the action being performed.
* @param JTable $table A JTable object containing the record to be deleted
*
* @return boolean True on success.
*
* @since 2.5
* @throws Exception on database error.
*/
public function onFinderAfterDelete($context, $table)
{
if ($context == 'easysocial.users') {
$id = $table->id;
$db = FD::db();
$sql = $db->sql();
$query = "select `link_id` from `#__finder_links` where `url` like '%option=com_easysocial&view=profile&id={$id}%'";
$sql->raw($query);
$db->setQuery($sql);
$item = $db->loadResult();
if ($item) {
// Index the item.
if (FD::isJoomla30()) {
$this->indexer->remove($item);
} else {
FinderIndexer::remove($item);
}
}
return true;
} elseif ($context == 'com_finder.index') {
$id = $table->link_id;
} else {
return true;
}
// Remove the items.
return $this->remove($id);
}