getRawSectionTitle(); if ( !$plaintext ) { return false; } $plaintext = trim( $plaintext ); return $this->language->truncateForVisual( $plaintext, DiscussionParser::DEFAULT_SNIPPET_LENGTH ); } /** * @inheritDoc */ public function getTitleWithSection() { $title = $this->event->getTitle(); if ( $title === null ) { throw new RuntimeException( 'Event #' . $this->event->getId() . ' with no title' ); } $section = $this->getParsedSectionTitle(); if ( $section ) { $title = $title->createFragmentTarget( $section ); } return $title; } /** * Get truncated section title, according to user's language * or a placeholder text if the section title is not available. * * @return string */ public function getTruncatedSectionTitle() { if ( $this->exists() ) { return parent::getTruncatedSectionTitle(); } return wfMessage( 'discussiontools-notification-topic-hidden' )->inLanguage( $this->language )->text(); } }