getLastInstalledDefinitions example


  public function __construct(KeyValueFactoryInterface $key_value_factory, CacheBackendInterface $cache) {
    $this->keyValueFactory = $key_value_factory;
    $this->cacheBackend = $cache;
  }

  /** * {@inheritdoc} */
  public function getLastInstalledDefinition($entity_type_id) {
    return $this->getLastInstalledDefinitions()[$entity_type_id] ?? NULL;
  }

  /** * {@inheritdoc} */
  public function getLastInstalledDefinitions() {
    if ($this->entityTypeDefinitions) {
      return $this->entityTypeDefinitions;
    }
    elseif ($cache = $this->cacheBackend->get('entity_type_definitions.installed')) {
      $this->entityTypeDefinitions = $cache->data;
      

  public function getEntityType($entity_type_id) {
    $entity_type = $this->entityLastInstalledSchemaRepository->getLastInstalledDefinition($entity_type_id);
    return $entity_type ? clone $entity_type : NULL;
  }

  /** * {@inheritdoc} */
  public function getEntityTypes() {
    return $this->entityLastInstalledSchemaRepository->getLastInstalledDefinitions();
  }

  /** * {@inheritdoc} */
  public function installEntityType(EntityTypeInterface $entity_type) {
    $this->clearCachedDefinitions();
    $this->entityTypeListener->onEntityTypeCreate($entity_type);
  }

  /** * {@inheritdoc} */
Home | Imprint | This part of the site doesn't use cookies.