Capsule
2 years ago
Concerns
2 weeks ago
Connectors
2 weeks ago
Console
2 weeks ago
DBAL
2 weeks ago
Eloquent
2 weeks ago
Events
2 weeks ago
Migrations
2 weeks ago
PDO
2 weeks ago
Query
2 weeks ago
Schema
2 weeks ago
ClassMorphViolationException.php
2 years ago
ConfigurationUrlParser.php
2 years ago
Connection.php
2 weeks ago
ConnectionInterface.php
2 years ago
ConnectionResolver.php
2 weeks ago
ConnectionResolverInterface.php
2 years ago
DatabaseManager.php
2 weeks ago
DatabaseServiceProvider.php
2 weeks ago
DatabaseTransactionRecord.php
2 weeks ago
DatabaseTransactionsManager.php
2 weeks ago
DeadlockException.php
2 weeks ago
DetectsConcurrencyErrors.php
2 years ago
DetectsLostConnections.php
2 weeks ago
Grammar.php
2 weeks ago
LazyLoadingViolationException.php
2 years ago
LostConnectionException.php
2 weeks ago
MigrationServiceProvider.php
2 weeks ago
MultipleColumnsSelectedException.php
2 weeks ago
MultipleRecordsFoundException.php
2 weeks ago
MySqlConnection.php
2 weeks ago
PostgresConnection.php
2 weeks ago
QueryException.php
2 years ago
RecordsNotFoundException.php
2 years ago
SQLiteConnection.php
2 weeks ago
SQLiteDatabaseDoesNotExistException.php
2 weeks ago
Seeder.php
2 weeks ago
SqlServerConnection.php
2 weeks ago
DatabaseTransactionRecord.php
69 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWPSCOPED\Illuminate\Database; |
| 4 | |
| 5 | /** @internal */ |
| 6 | class DatabaseTransactionRecord |
| 7 | { |
| 8 | /** |
| 9 | * The name of the database connection. |
| 10 | * |
| 11 | * @var string |
| 12 | */ |
| 13 | public $connection; |
| 14 | /** |
| 15 | * The transaction level. |
| 16 | * |
| 17 | * @var int |
| 18 | */ |
| 19 | public $level; |
| 20 | /** |
| 21 | * The callbacks that should be executed after committing. |
| 22 | * |
| 23 | * @var array |
| 24 | */ |
| 25 | protected $callbacks = []; |
| 26 | /** |
| 27 | * Create a new database transaction record instance. |
| 28 | * |
| 29 | * @param string $connection |
| 30 | * @param int $level |
| 31 | * @return void |
| 32 | */ |
| 33 | public function __construct($connection, $level) |
| 34 | { |
| 35 | $this->connection = $connection; |
| 36 | $this->level = $level; |
| 37 | } |
| 38 | /** |
| 39 | * Register a callback to be executed after committing. |
| 40 | * |
| 41 | * @param callable $callback |
| 42 | * @return void |
| 43 | */ |
| 44 | public function addCallback($callback) |
| 45 | { |
| 46 | $this->callbacks[] = $callback; |
| 47 | } |
| 48 | /** |
| 49 | * Execute all of the callbacks. |
| 50 | * |
| 51 | * @return void |
| 52 | */ |
| 53 | public function executeCallbacks() |
| 54 | { |
| 55 | foreach ($this->callbacks as $callback) { |
| 56 | $callback(); |
| 57 | } |
| 58 | } |
| 59 | /** |
| 60 | * Get all of the callbacks. |
| 61 | * |
| 62 | * @return array |
| 63 | */ |
| 64 | public function getCallbacks() |
| 65 | { |
| 66 | return $this->callbacks; |
| 67 | } |
| 68 | } |
| 69 |