class RealisticDummyContentTextWithSummaryField in Realistic Dummy Content 3.x
Same name and namespace in other branches
- 8.2 api/src/includes/RealisticDummyContentTextWithSummaryField.php \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentTextWithSummaryField
- 7.2 api/src/includes/RealisticDummyContentTextWithSummaryField.php \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentTextWithSummaryField
Represents the text with summary field.
This field must have a text format when part of an entity object. Node body is one example.
Hierarchy
- class \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentAttribute uses RealisticDummyContentDrupalTrait
- class \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentField
- class \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentTextWithSummaryField
- class \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentField
Expanded class hierarchy of RealisticDummyContentTextWithSummaryField
File
- api/
src/ includes/ RealisticDummyContentTextWithSummaryField.php, line 13
Namespace
Drupal\realistic_dummy_content_api\includesView source
class RealisticDummyContentTextWithSummaryField extends RealisticDummyContentField {
/**
* {@inheritdoc}
*/
public function implementValueFromFile($file) : array {
$value = $file
->Value();
// @TODO use the site's default, not Framework::instance()->filteredHtml(), as the
// default format.
$format = $file
->Attribute('format', Framework::instance()
->filteredHtml());
// If the value cannot be determined, which is different from an empty
// string.
if ($value === NULL) {
return [];
}
if ($value) {
$return = Framework::instance()
->formatProperty('text_with_summary', $value, [
'format' => $format,
]);
return $return;
}
else {
return [];
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RealisticDummyContentAttribute:: |
private | property | Entity managed by this class. | |
RealisticDummyContentAttribute:: |
private | property | The name of this attribuet, for example title, picture, field_image... | |
RealisticDummyContentAttribute:: |
public | function | Changes this attribute by looking for data in files. | |
RealisticDummyContentAttribute:: |
public | function | Given candidate files, change value of this attribute based on one of them. | |
RealisticDummyContentAttribute:: |
public | function | Returns the appropriate environment, real or testing. | |
RealisticDummyContentAttribute:: |
public | function | Return a file object. | |
RealisticDummyContentAttribute:: |
public | function | Gets the bundle of the associated entity. | |
RealisticDummyContentAttribute:: |
public | function | Get all candidate files for a given field for this entity. | |
RealisticDummyContentAttribute:: |
public | function | Getter for $this->entity. | |
RealisticDummyContentAttribute:: |
public | function | Get the entity type of the associated entity. | |
RealisticDummyContentAttribute:: |
public | function | Get acceptable file extensions which contain data for this attribute. | 1 |
RealisticDummyContentAttribute:: |
public | function | Return acceptable image file extensions. | |
RealisticDummyContentAttribute:: |
public | function | Getter for $this->name. | |
RealisticDummyContentAttribute:: |
public | function | Return acceptable text file extensions. | |
RealisticDummyContentAttribute:: |
public | function | Gets the UID of the associated entity. | |
RealisticDummyContentAttribute:: |
public | function | Return an image file object if possible. | |
RealisticDummyContentAttribute:: |
public | function | Returns a pseudo-random number. | |
RealisticDummyContentAttribute:: |
public | function | Given a RealisticDummyContentFileGroup object, get structured property. | |
RealisticDummyContentAttribute:: |
public | function | Given a list of files, return a value from one of them. | |
RealisticDummyContentAttribute:: |
public | function | Constructor. | |
RealisticDummyContentDrupalTrait:: |
public | function | Mockable wrapper around Framework::fieldInfoField(). | |
RealisticDummyContentDrupalTrait:: |
public | function | Mockable wrapper around Framework::getAllVocabularies(). | |
RealisticDummyContentDrupalTrait:: |
public | function | Mockable wrapper around Framework::newVocabularyTerm(). | |
RealisticDummyContentDrupalTrait:: |
public | function | Mockable wrapper around Framework::taxonomyLoadTree(). | |
RealisticDummyContentDrupalTrait:: |
public | function | Mockable wrapper around Framework::termId(). | |
RealisticDummyContentDrupalTrait:: |
public | function | Mockable wrapper around Framework::termName(). | |
RealisticDummyContentDrupalTrait:: |
public | function | Mockable wrapper around Framework::vocabularyMachineName(). | |
RealisticDummyContentDrupalTrait:: |
public | function | Log a \Throwable to the watchdog. | |
RealisticDummyContentField:: |
public | function |
Returns the type of this attribute. Overrides RealisticDummyContentAttribute:: |
|
RealisticDummyContentTextWithSummaryField:: |
public | function |
Given a RealisticDummyContentFileGroup object, get a structured property. Overrides RealisticDummyContentAttribute:: |