class TagProcessResult in Extensible BBCode 4.0.x
Same name and namespace in other branches
- 8.3 src/TagProcessResult.php \Drupal\xbbcode\TagProcessResult
Represents the output of a tag processor in a tree.
Hierarchy
- class \Drupal\Core\Cache\CacheableMetadata implements RefinableCacheableDependencyInterface uses RefinableCacheableDependencyTrait
- class \Drupal\Core\Render\BubbleableMetadata implements AttachmentsInterface uses AttachmentsTrait
- class \Drupal\xbbcode\TagProcessResult implements OutputElementInterface
- class \Drupal\Core\Render\BubbleableMetadata implements AttachmentsInterface uses AttachmentsTrait
Expanded class hierarchy of TagProcessResult
8 files declare their use of TagProcessResult
- CodeTagPlugin.php in standard/
src/ Plugin/ XBBCode/ CodeTagPlugin.php - EntityTagPlugin.php in src/
Plugin/ XBBCode/ EntityTagPlugin.php - NullTagPlugin.php in src/
Plugin/ XBBCode/ NullTagPlugin.php - RenderTagPlugin.php in src/
Plugin/ RenderTagPlugin.php - TagPluginBase.php in src/
Plugin/ TagPluginBase.php
File
- src/
TagProcessResult.php, line 11
Namespace
Drupal\xbbcodeView source
class TagProcessResult extends BubbleableMetadata implements OutputElementInterface {
/**
* Processed content.
*
* @var string
*/
protected $processedText;
/**
* TagProcessResult constructor.
*
* @param string|null $processedText
* Processed content.
*/
public function __construct(string $processedText = NULL) {
$this->processedText = $processedText;
}
/**
* Get processed content.
*
* @return string
* Processed content.
*/
public function getProcessedText() : string {
return $this->processedText;
}
/**
* Set processed content.
*
* @param string $processedText
* Processed content.
*/
public function setProcessedText(string $processedText) : void {
$this->processedText = $processedText;
}
/**
* Concatenate a sequence of results into one.
*
* @param \Drupal\xbbcode\TagProcessResult[] $children
* Sequence of tag process results.
*
* @return \Drupal\xbbcode\TagProcessResult
* The concatenated result with merged metadata.
*/
public static function create(array $children) : TagProcessResult {
$result = new TagProcessResult(implode('', $children));
foreach ($children as $child) {
$result = $result
->merge($child);
}
return $result;
}
/**
* {@inheritdoc}
*/
public function __toString() : string {
return (string) $this->processedText;
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AttachmentsTrait:: |
protected | property | The attachments for this response. | |
AttachmentsTrait:: |
public | function | ||
AttachmentsTrait:: |
public | function | ||
AttachmentsTrait:: |
public | function | ||
BubbleableMetadata:: |
public | function |
Overrides RefinableCacheableDependencyTrait:: |
|
BubbleableMetadata:: |
public | function |
Applies the values of this bubbleable metadata object to a render array. Overrides CacheableMetadata:: |
|
BubbleableMetadata:: |
public static | function |
Creates a bubbleable metadata object from a depended object. Overrides CacheableMetadata:: |
|
BubbleableMetadata:: |
public static | function |
Creates a bubbleable metadata object with values taken from a render array. Overrides CacheableMetadata:: |
|
BubbleableMetadata:: |
public | function |
Creates a new bubbleable metadata object by merging this one with another. Overrides CacheableMetadata:: |
|
BubbleableMetadata:: |
public static | function | Merges two attachments arrays (which live under the '#attached' key). | |
CacheableDependencyTrait:: |
protected | property | Cache contexts. | |
CacheableDependencyTrait:: |
protected | property | Cache max-age. | |
CacheableDependencyTrait:: |
protected | property | Cache tags. | |
CacheableDependencyTrait:: |
protected | function | Sets cacheability; useful for value object constructors. | |
CacheableMetadata:: |
public | function |
The cache contexts associated with this object. Overrides CacheableDependencyTrait:: |
|
CacheableMetadata:: |
public | function |
The maximum age for which this object may be cached. Overrides CacheableDependencyTrait:: |
|
CacheableMetadata:: |
public | function |
The cache tags associated with this object. Overrides CacheableDependencyTrait:: |
|
CacheableMetadata:: |
public | function | Sets cache contexts. | |
CacheableMetadata:: |
public | function | Sets the maximum age (in seconds). | |
CacheableMetadata:: |
public | function | Sets cache tags. | |
RefinableCacheableDependencyTrait:: |
public | function | ||
RefinableCacheableDependencyTrait:: |
public | function | ||
RefinableCacheableDependencyTrait:: |
public | function | ||
TagProcessResult:: |
protected | property | Processed content. | |
TagProcessResult:: |
public static | function | Concatenate a sequence of results into one. | |
TagProcessResult:: |
public | function | Get processed content. | |
TagProcessResult:: |
public | function | Set processed content. | |
TagProcessResult:: |
public | function | TagProcessResult constructor. | |
TagProcessResult:: |
public | function |
Convert to string. Overrides OutputElementInterface:: |