You are here

public function AllowedLanguagesManager::isEntityLanguageControlled in Allowed Languages 2.x

Decide whether the entity should be language controlled or not.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity to test.

Return value

bool TRUE if the entity should have permissions applied, FALSE otherwise.

Overrides AllowedLanguagesManagerInterface::isEntityLanguageControlled

File

src/AllowedLanguagesManager.php, line 102

Class

AllowedLanguagesManager
The allowed language manager controls access to content by language.

Namespace

Drupal\allowed_languages

Code

public function isEntityLanguageControlled(EntityInterface $entity) {
  if ($entity instanceof ContentEntityInterface && $entity
    ->isTranslatable()) {
    return TRUE;
  }
  return FALSE;
}