You are here

public function RealisticDummyContentFieldModifier::getProperties in Realistic Dummy Content 3.x

Same name and namespace in other branches
  1. 8.2 api/src/includes/RealisticDummyContentFieldModifier.php \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentFieldModifier::getProperties()
  2. 7.2 api/src/includes/RealisticDummyContentFieldModifier.php \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentFieldModifier::getProperties()

Get properties for the entity, for example user's picture or node's name.

Return value

array An array of RealisticDummyContentAttribute objects, keyed by attribute name, e.g. title => [RealisticDummyContentAttribute], field_image => [RealisticDummyContentAttribute]

1 call to RealisticDummyContentFieldModifier::getProperties()
RealisticDummyContentFieldModifier::getAttributes in api/src/includes/RealisticDummyContentFieldModifier.php
Returns all fields and properties.

File

api/src/includes/RealisticDummyContentFieldModifier.php, line 46

Class

RealisticDummyContentFieldModifier
Field modifier class.

Namespace

Drupal\realistic_dummy_content_api\includes

Code

public function getProperties() {
  $modifiable_properties = [];
  $fields = $this
    ->getFields();
  foreach (Framework::instance()
    ->entityProperties($this
    ->getEntity()) as $property => $info) {
    if (!in_array($property, array_keys($fields)) && $this
      ->filter($property)) {
      $this
        ->addModifier($modifiable_properties, 'property', $property);
    }
  }
  return $modifiable_properties;
}