protected function DateRecurOccurrences::getBaseFieldStorages in Recurring Dates Field 3.x
Same name and namespace in other branches
- 8.2 src/DateRecurOccurrences.php \Drupal\date_recur\DateRecurOccurrences::getBaseFieldStorages()
- 3.0.x src/DateRecurOccurrences.php \Drupal\date_recur\DateRecurOccurrences::getBaseFieldStorages()
- 3.1.x src/DateRecurOccurrences.php \Drupal\date_recur\DateRecurOccurrences::getBaseFieldStorages()
Get field storage for date recur base fields for an entity type.
Parameters
\Drupal\Core\Entity\ContentEntityTypeInterface $entityType: An entity type.
Return value
\Drupal\Core\Field\FieldStorageDefinitionInterface[] An array of storage definitions for base fields for an entity type.
2 calls to DateRecurOccurrences::getBaseFieldStorages()
- DateRecurOccurrences::onEntityTypeCreate in src/
DateRecurOccurrences.php - Reacts to the creation of the entity type.
- DateRecurOccurrences::onEntityTypeDelete in src/
DateRecurOccurrences.php - Reacts to the deletion of the entity type.
File
- src/
DateRecurOccurrences.php, line 422
Class
- DateRecurOccurrences
- Manages occurrences tables and the data that populates them.
Namespace
Drupal\date_recurCode
protected function getBaseFieldStorages(ContentEntityTypeInterface $entityType) : array {
$baseFields = $this->entityFieldManager
->getBaseFieldDefinitions($entityType
->id());
$baseFields = array_filter($baseFields, function (FieldDefinitionInterface $fieldDefinition) : bool {
return $this
->isDateRecur($fieldDefinition
->getFieldStorageDefinition());
});
return array_map(function (FieldDefinitionInterface $baseField) : FieldStorageDefinitionInterface {
return $baseField
->getFieldStorageDefinition();
}, $baseFields);
}