* @return array
*/
public static function getSelectQueryData() {
- $commentQuery = CommentStore::newKey( 'log_comment' )->getJoin();
+ $commentQuery = CommentStore::getStore()->getJoin( 'log_comment' );
$tables = [ 'logging', 'user' ] + $commentQuery['tables'];
$fields = [
}
public function getComment() {
- return CommentStore::newKey( 'log_comment' )->getComment( $this->row )->text;
+ return CommentStore::getStore()->getComment( 'log_comment', $this->row )->text;
}
public function getDeleted() {
}
public function getComment() {
- return CommentStore::newKey( 'rc_comment' )
- // Legacy because the row probably used RecentChange::selectFields()
- ->getCommentLegacy( wfGetDB( DB_REPLICA ), $this->row )->text;
+ return CommentStore::getStore()
+ // Legacy because the row may have used RecentChange::selectFields()
+ ->getCommentLegacy( wfGetDB( DB_REPLICA ), 'rc_comment', $this->row )->text;
}
public function getDeleted() {
* @throws MWException
*/
public function insert( IDatabase $dbw = null ) {
- global $wgContLang;
-
$dbw = $dbw ?: wfGetDB( DB_MASTER );
if ( $this->timestamp === null ) {
// Trim spaces on user supplied text
$comment = trim( $this->getComment() );
- // Truncate for whole multibyte characters.
- $comment = $wgContLang->truncate( $comment, 255 );
-
$params = $this->getParameters();
$relations = $this->relations;
if ( isset( $this->deleted ) ) {
$data['log_deleted'] = $this->deleted;
}
- $data += CommentStore::newKey( 'log_comment' )->insert( $dbw, $comment );
+ $data += CommentStore::getStore()->insert( $dbw, 'log_comment', $comment );
$dbw->insert( 'logging', $data, __METHOD__ );
$this->id = $dbw->insertId();