requiresFieldStorageSchemaChanges example

/** * {@inheritdoc} */
  public function requiresEntityStorageSchemaChanges(EntityTypeInterface $entity_type, EntityTypeInterface $original) {
    return $this->getStorageSchema()->requiresEntityStorageSchemaChanges($entity_type$original);
  }

  /** * {@inheritdoc} */
  public function requiresFieldStorageSchemaChanges(FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original) {
    return $this->getStorageSchema()->requiresFieldStorageSchemaChanges($storage_definition$original);
  }

  /** * {@inheritdoc} */
  public function requiresEntityDataMigration(EntityTypeInterface $entity_type, EntityTypeInterface $original) {
    return $this->getStorageSchema()->requiresEntityDataMigration($entity_type$original);
  }

  /** * {@inheritdoc} */


          // Detect updated field storage definitions.           foreach (array_intersect_key($storage_definitions$original_storage_definitions) as $field_name => $storage_definition) {
            // @todo Support non-storage-schema-changing definition updates too:             // https://www.drupal.org/node/2336895. So long as we're checking             // based on schema change requirements rather than definition             // equality, skip the check if the entity type itself needs to be             // updated, since that can affect the schema of all fields, so we             // want to process that update first without reporting false             // positives here.             if (!isset($change_list[$entity_type_id]['entity_type']) && $this->requiresFieldStorageSchemaChanges($storage_definition$original_storage_definitions[$field_name])) {
              $field_changes[$field_name] = static::DEFINITION_UPDATED;
            }
          }

          if ($field_changes) {
            $change_list[$entity_type_id]['field_storage_definitions'] = $field_changes;
          }
        }
      }
    }

    
Home | Imprint | This part of the site doesn't use cookies.