/** * onContentAvailable * * @param mixed $table * @param mixed $model * @access public * @return void */ public function onContentAvailable($table, $model) { $type = $this->getType($table); $id = $model->getPkValue(); if ($type != false) { \Components\Search\Helpers\SolrHelper::enqueueDB($type, array($id), 'index'); } }
/** * addToBlacklistTask - Makes a database entry and removes from index * * @access public * @return void */ public function addToBlacklistTask() { $id = Request::getVar('id', ''); // Make entry on blacklist $entry = Blacklist::oneOrNew(0); $entry->set('doc_id', $id); $entry->set('created', \Date::of()->toSql()); $entry->set('created_by', User::getInstance()->get('id', 0)); $entry->save(); $item = SolrHelper::parseDocumentID($id); // Remove from index if (SolrHelper::enqueueDB($item['type'], array($item['id']), 'delete')) { // Redirect back to the search page. App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller . '&task=documentByType&type=' . $item['type'], false), 'Submitted ' . $id . ' for removal.', 'success'); } else { // Redirect back to the search page. App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller . '&task=documentByType&type=' . $scope, false), 'Failed to remove ' . $id, 'error'); } }