public function EntityLastInstalledSchemaRepository::__construct in Drupal 9
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Entity/EntityLastInstalledSchemaRepository.php \Drupal\Core\Entity\EntityLastInstalledSchemaRepository::__construct()
Constructs a new EntityLastInstalledSchemaRepository.
Parameters
\Drupal\Core\KeyValueStore\KeyValueFactoryInterface $key_value_factory: The key-value factory.
\Drupal\Core\Cache\CacheBackendInterface $cache: The cache backend.
File
- core/
lib/ Drupal/ Core/ Entity/ EntityLastInstalledSchemaRepository.php, line 44
Class
- EntityLastInstalledSchemaRepository
- Provides a repository for installed entity definitions.
Namespace
Drupal\Core\EntityCode
public function __construct(KeyValueFactoryInterface $key_value_factory, CacheBackendInterface $cache = NULL) {
$this->keyValueFactory = $key_value_factory;
if (!$cache) {
@trigger_error('The cache.discovery service must be passed to EntityLastInstalledSchemaRepository::__construct(), it is required before drupal:10.0.0.', E_USER_DEPRECATED);
$cache = \Drupal::cache('discovery');
}
$this->cacheBackend = $cache;
}