You are here

public function RealisticDummyContentFieldModifier::getUid in Realistic Dummy Content 7.2

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

Get the uid property of this entity, or 0.

Return value

int The uid of the associated entity.

File

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

Class

RealisticDummyContentFieldModifier
Field modifier class.

Namespace

Drupal\realistic_dummy_content_api\includes

Code

public function getUid() {
  $entity = $this
    ->getEntity();
  if (isset($entity->uid)) {
    return $entity->uid;
  }
  else {
    return 0;
  }
}