public function Drupal7::entityIsDummy in Realistic Dummy Content 8.2
Same name and namespace in other branches
- 7.2 api/src/Framework/Drupal7.php \Drupal\realistic_dummy_content_api\Framework\Drupal7::entityIsDummy()
File
- api/src/Framework/Drupal7.php, line 205
Class
- Drupal7
- Drupal 7-specific code.
Namespace
Drupal\realistic_dummy_content_api\Framework
Code
public function entityIsDummy($entity, $type) {
$return = FALSE;
if (isset($entity->devel_generate)) {
return TRUE;
}
switch ($type) {
case 'user':
$suffix = '.invalid';
if (isset($entity->mail) && $this
->drupalSubstr($entity->mail, strlen($entity->mail) - strlen($suffix)) == $suffix) {
return TRUE;
}
break;
default:
break;
}
return $return;
}