/** * Get HTML output (exactly the same as for the 'table' result format) and * prepare mail merge data. Perhaps storing the latter in the DB should be * done elsewhere. * * @uses SMWTableResultPrinter::getResultText() * @return string */ protected function getResultText(\SMWQueryResult $queryResult, $outputmode) { global $wgTitle; $this->pageTitle = "{$wgTitle}"; $this->emailsTable = new SemanticMailMerge_ORM(); $this->emailsTable->delete(array('title' => $this->pageTitle)); $results = clone $queryResult; while ($row = $results->getNext()) { $this->handleRow($row); } return parent::getResultText($queryResult, $outputmode); }
/** * Removes the object from the database. * * @since 1.20 * * @return boolean Success indicator */ public function remove() { $this->beforeRemove(); $success = $this->table->delete(array('id' => $this->getId())); // DatabaseBase::delete does not always return true for success as documented... $success = $success !== false; if ($success) { $this->onRemoved(); } return $success; }