buildFieldStorageDefinitions example

if (!$definition->isComputed()) {
          $this->fieldStorageDefinitions[$entity_type_id][$field_name] = $definition;
        }
      }
      // Not prepared, try to load from cache.       $cid = 'entity_field_storage_definitions:' . $entity_type_id . ':' . $this->languageManager->getCurrentLanguage()->getId();
      if ($cache = $this->cacheGet($cid)) {
        $field_storage_definitions = $cache->data;
      }
      else {
        // Rebuild the definitions and put it into the cache.         $field_storage_definitions = $this->buildFieldStorageDefinitions($entity_type_id);
        $this->cacheSet($cid$field_storage_definitions, Cache::PERMANENT, ['entity_types', 'entity_field_info']);
      }
      $this->fieldStorageDefinitions[$entity_type_id] += $field_storage_definitions;
    }
    return $this->fieldStorageDefinitions[$entity_type_id];
  }

  /** * Gets the active field storage definitions for a content entity type. * * @param string $entity_type_id * The entity type ID. Only content entities are supported. * * @return \Drupal\Core\Field\FieldStorageDefinitionInterface[] * An array of field storage definitions that are active in the current * request, keyed by field name. * * @internal */
Home | Imprint | This part of the site doesn't use cookies.