RealisticDummyContentImageField.php in Realistic Dummy Content 3.x
File
api/src/includes/RealisticDummyContentImageField.php
View source
<?php
namespace Drupal\realistic_dummy_content_api\includes;
use Drupal\realistic_dummy_content_api\Framework\Framework;
class RealisticDummyContentImageField extends RealisticDummyContentField {
public function getExtensions() {
return $this
->getImageExtensions();
}
public function implementValueFromFile($file) : array {
if (!$file
->value()) {
return [];
}
$return = [];
$file = $this
->imageSave($file);
if ($file) {
$return = Framework::instance()
->formatProperty('file', $file);
}
return $return;
}
}