interface SerialStorageInterface in Serial Field 8
Defines an interface for serial storage classes.
Hierarchy
- interface \Drupal\serial\SerialStorageInterface
Expanded class hierarchy of SerialStorageInterface
All classes that implement SerialStorageInterface
1 file declares its use of SerialStorageInterface
- serial.module in ./
serial.module - The Serial module main file.
File
- src/
SerialStorageInterface.php, line 12
Namespace
Drupal\serialView source
interface SerialStorageInterface {
const SERIAL_FIELD_TYPE = 'serial';
/**
* Creates the assistant storage name for a specific field.
*
* @param \Drupal\Core\Field\FieldDefinitionInterface $fieldDefinition
* Field definition.
* @param \Drupal\Core\Entity\FieldableEntityInterface $entity
* Entity.
*
* @return string
* Storage name.
*/
public function createStorageNameFromField(FieldDefinitionInterface $fieldDefinition, FieldableEntityInterface $entity);
/**
* Creates the storage name.
*
* @param string $entityTypeId
* Entity type id.
* @param string $entityBundle
* Entity bundle (entity type) name.
* @param string $fieldName
* Field name.
*
* @return string
* Storage name.
*/
public function createStorageName($entityTypeId, $entityBundle, $fieldName);
/**
* Generates a unique serial value (unique per entity bundle).
*
* @param string $storageName
* Storage name.
* @param bool $delete
* Indicates if temporary records should be deleted.
*
* @return int
* Unique serial id.
*/
public function generateValueFromName($storageName, $delete = TRUE);
/**
* Generates a unique serial value (unique per entity bundle).
*
* @param \Drupal\Core\Field\FieldDefinitionInterface $fieldDefinition
* Field definition.
* @param \Drupal\Core\Entity\FieldableEntityInterface $entity
* Entity.
* @param bool $delete
* Indicates if temporary records should be deleted.
*
* @return int
* Unique serial id.
*/
public function generateValue(FieldDefinitionInterface $fieldDefinition, FieldableEntityInterface $entity, $delete = TRUE);
/**
* Gets the schema of the assistant storage for generating serial values.
*
* @return array
* Assistant storage schema.
*/
public function getSchema();
/**
* Gets a lightweight map of fields across bundles filtered by field type.
*
* @return array
* An array keyed by entity type. Each value is an array which keys are
* field names and value is an array with two entries:
* - type: The field type.
* - bundles: An associative array of the bundles in which the field
* appears, where the keys and values are both the bundle's machine name.
*/
public function getAllFields();
/**
* Creates an assistant serial storage for a new created field.
*
* @param \Drupal\Core\Field\FieldDefinitionInterface $fieldDefinition
* Field definition.
* @param \Drupal\Core\Entity\FieldableEntityInterface $entity
* Entity.
*/
public function createStorage(FieldDefinitionInterface $fieldDefinition, FieldableEntityInterface $entity);
/**
* Creates an assistant serial storage for a new created field.
*
* @param string $storageName
* Storage name.
*/
public function createStorageFromName($storageName);
/**
* Drops an assistant serial storage for a deleted field.
*
* @param \Drupal\Core\Field\FieldDefinitionInterface $fieldDefinition
* Field definition.
* @param \Drupal\Core\Entity\FieldableEntityInterface $entity
* Entity.
*/
public function dropStorage(FieldDefinitionInterface $fieldDefinition, FieldableEntityInterface $entity);
/**
* Drops an assistant serial storage for a deleted field.
*
* @param string $storageName
* Storage name.
*/
public function dropStorageFromName($storageName);
/**
* Initializes the value of a new serial field in existing entities.
*
* @param string $entityTypeId
* Entity type id.
* @param string $entityBundle
* Entity bundle (entity type) name.
* @param string $fieldName
* Field name.
* @param int $startValue
* The value to start the serial increment with.
*
* @return int
* Amount of entries that were updated.
*/
public function initOldEntries($entityTypeId, $entityBundle, $fieldName, $startValue);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SerialStorageInterface:: |
public | function | Creates an assistant serial storage for a new created field. | 1 |
SerialStorageInterface:: |
public | function | Creates an assistant serial storage for a new created field. | 1 |
SerialStorageInterface:: |
public | function | Creates the storage name. | 1 |
SerialStorageInterface:: |
public | function | Creates the assistant storage name for a specific field. | 1 |
SerialStorageInterface:: |
public | function | Drops an assistant serial storage for a deleted field. | 1 |
SerialStorageInterface:: |
public | function | Drops an assistant serial storage for a deleted field. | 1 |
SerialStorageInterface:: |
public | function | Generates a unique serial value (unique per entity bundle). | 1 |
SerialStorageInterface:: |
public | function | Generates a unique serial value (unique per entity bundle). | 1 |
SerialStorageInterface:: |
public | function | Gets a lightweight map of fields across bundles filtered by field type. | 1 |
SerialStorageInterface:: |
public | function | Gets the schema of the assistant storage for generating serial values. | 1 |
SerialStorageInterface:: |
public | function | Initializes the value of a new serial field in existing entities. | 1 |
SerialStorageInterface:: |
constant |