protected function EntityFlagType::isFlaggableOwnable in Flag 8.4
Determines if the flaggable associated with the flag supports ownership.
Return value
boolean TRUE if the flaggable supports ownership.
1 call to EntityFlagType::isFlaggableOwnable()
- EntityFlagType::getExtraPermissionsOptions in src/
Plugin/ Flag/ EntityFlagType.php - Defines options for extra permissions.
1 method overrides EntityFlagType::isFlaggableOwnable()
- UserFlagType::isFlaggableOwnable in src/
Plugin/ Flag/ UserFlagType.php - Determines if the flaggable associated with the flag supports ownership.
File
- src/
Plugin/ Flag/ EntityFlagType.php, line 344
Class
- EntityFlagType
- Provides a flag type for all entity types.
Namespace
Drupal\flag\Plugin\FlagCode
protected function isFlaggableOwnable() {
$entity_type_id = $this->entityType;
// Get the entity type from the entity type manager.
$entity_type = $this->entityTypeManager
->getDefinition($entity_type_id);
// Only if the flaggable entities can be owned.
if ($entity_type
->entityClassImplements(EntityOwnerInterface::class)) {
return TRUE;
}
return FALSE;
}