BatchStorage
class BatchStorage implements BatchStorageInterface (View source)
Constants
| TABLE_NAME |
The table name. |
Properties
| protected Connection | $connection | The database connection. |
|
| protected SessionInterface | $session | The session. |
|
| protected CsrfTokenGenerator | $csrfToken | The CSRF token generator. |
Methods
Constructs the database batch storage service.
Loads a batch.
Deletes a batch.
Updates a batch.
Cleans up failed or old batches.
Creates and saves a batch.
Saves a batch.
Check if the table exists and create it if not.
Defines the schema for the batch table.
Details
__construct(Connection $connection, SessionInterface $session, CsrfTokenGenerator $csrf_token)
Constructs the database batch storage service.
array
load(int $id)
Loads a batch.
delete(int $id)
Deletes a batch.
update(array $batch)
Updates a batch.
cleanup()
Cleans up failed or old batches.
create(array $batch)
Creates and saves a batch.
protected
doCreate(array $batch)
Saves a batch.
protected
ensureTableExists()
Check if the table exists and create it if not.
protected
catchException(Exception $e)
Act on an exception when batch might be stale.
If the table does not yet exist, that's fine, but if the table exists and yet the query failed, then the batch is stale and the exception needs to propagate.
schemaDefinition()
| internal |
Defines the schema for the batch table.