function EntityManager::useCaches

Overrides CachedDiscoveryInterface::useCaches

See also

https://www.drupal.org/node/2549139

File

core/lib/Drupal/Core/Entity/EntityManager.php, line 798

Class

EntityManager
Provides a wrapper around many other services relating to entities.

Namespace

Drupal\Core\Entity

Code

public function useCaches($use_caches = FALSE) {
    @trigger_error('EntityManagerInterface::useCaches() is deprecated in 8.0.0 and will be removed before Drupal 9.0.0. Use \\Drupal\\Core\\Entity\\EntityTypeManagerInterface::useCaches() and/or Drupal\\Core\\Entity\\EntityFieldManagerInterface::useCaches() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
    $this->container
        ->get('entity_type.manager')
        ->useCaches($use_caches);
    // @todo EntityFieldManager is not a plugin manager, and should not co-opt
    //   this method for managing its caches.
    $this->container
        ->get('entity_field.manager')
        ->useCaches($use_caches);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.