RealisticDummyContentTextWithSummaryField.php in Realistic Dummy Content 3.x
File
api/src/includes/RealisticDummyContentTextWithSummaryField.php
View source
<?php
namespace Drupal\realistic_dummy_content_api\includes;
use Drupal\realistic_dummy_content_api\Framework\Framework;
class RealisticDummyContentTextWithSummaryField extends RealisticDummyContentField {
public function implementValueFromFile($file) : array {
$value = $file
->Value();
$format = $file
->Attribute('format', Framework::instance()
->filteredHtml());
if ($value === NULL) {
return [];
}
if ($value) {
$return = Framework::instance()
->formatProperty('text_with_summary', $value, [
'format' => $format,
]);
return $return;
}
else {
return [];
}
}
}