private function DibaCarousel::getValidBundles in Diba carousel slider 8
Get valid $bundles to be used in a query.
1 call to DibaCarousel::getValidBundles()
- DibaCarousel::getQueriedEntities in src/
Plugin/ Block/ DibaCarousel.php - Use the block settings to query entities.
File
- src/
Plugin/ Block/ DibaCarousel.php, line 746
Class
- DibaCarousel
- Provides a Diba carousel Block.
Namespace
Drupal\diba_carousel\Plugin\BlockCode
private function getValidBundles($bundles, $entity) {
$entityBundles = $this
->getEntityTypeBundles($entity);
$valid_bundles = [];
foreach ($bundles as $key => $value) {
if (!empty($value) && isset($entityBundles[$key])) {
$valid_bundles[] = $key;
}
}
return $valid_bundles;
}