You are here

public function RealisticDummyContentAttribute::change in Realistic Dummy Content 8.2

Same name and namespace in other branches
  1. 7.2 api/src/includes/RealisticDummyContentAttribute.php \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentAttribute::change()
  2. 3.x api/src/includes/RealisticDummyContentAttribute.php \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentAttribute::change()

Changes this attribute by looking for data in files.

Any module can define a file hierarchy to determine realistic dummy data for this attribute. See the ./realistic_dummy_content/ folder for an example.

This function checks the filesystem for compatible files (for example, only image files are acceptable candidate files for field_image), choose one through the selection mechanism (random or sequential), and then procedes to change the data for the associated field for this class.

File

api/src/includes/RealisticDummyContentAttribute.php, line 136

Class

RealisticDummyContentAttribute
Represents either a field or a property for an entity.

Namespace

Drupal\realistic_dummy_content_api\includes

Code

public function change() {
  $files = $this
    ->getCandidateFiles();
  $this
    ->changeFromFiles($files);
}