public function DemoContent::removeContent in Open Social 8
Same name and namespace in other branches
- 8.9 modules/custom/social_demo/src/DemoContent.php \Drupal\social_demo\DemoContent::removeContent()
- 8.2 modules/custom/social_demo/src/DemoContent.php \Drupal\social_demo\DemoContent::removeContent()
- 8.3 modules/custom/social_demo/src/DemoContent.php \Drupal\social_demo\DemoContent::removeContent()
- 8.4 modules/custom/social_demo/src/DemoContent.php \Drupal\social_demo\DemoContent::removeContent()
- 8.5 modules/custom/social_demo/src/DemoContent.php \Drupal\social_demo\DemoContent::removeContent()
- 8.6 modules/custom/social_demo/src/DemoContent.php \Drupal\social_demo\DemoContent::removeContent()
- 8.7 modules/custom/social_demo/src/DemoContent.php \Drupal\social_demo\DemoContent::removeContent()
- 8.8 modules/custom/social_demo/src/DemoContent.php \Drupal\social_demo\DemoContent::removeContent()
- 10.3.x modules/custom/social_demo/src/DemoContent.php \Drupal\social_demo\DemoContent::removeContent()
- 10.0.x modules/custom/social_demo/src/DemoContent.php \Drupal\social_demo\DemoContent::removeContent()
- 10.1.x modules/custom/social_demo/src/DemoContent.php \Drupal\social_demo\DemoContent::removeContent()
- 10.2.x modules/custom/social_demo/src/DemoContent.php \Drupal\social_demo\DemoContent::removeContent()
Removes content.
Overrides DemoContentInterface::removeContent
File
- modules/
custom/ social_demo/ src/ DemoContent.php, line 87
Class
- DemoContent
- Class DemoContent.
Namespace
Drupal\social_demoCode
public function removeContent() {
$data = $this
->fetchData();
foreach ($data as $uuid => $item) {
// Must have uuid and same key value.
if ($uuid !== $item['uuid']) {
continue;
}
$entities = $this->entityStorage
->loadByProperties([
'uuid' => $uuid,
]);
foreach ($entities as $entity) {
$entity
->delete();
}
}
}