Skip to content

Commit 2a1a55c

Browse files
Add getter and setter for connection in the DatabaseBatchRepository class (#43869)
* Add `setConnection` and `getConnection` methods * Update DatabaseBatchRepository.php Co-authored-by: Taylor Otwell <[email protected]>
1 parent c5772dd commit 2a1a55c

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/Illuminate/Bus/DatabaseBatchRepository.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,4 +341,25 @@ protected function toBatch($batch)
341341
$batch->finished_at ? CarbonImmutable::createFromTimestamp($batch->finished_at) : $batch->finished_at
342342
);
343343
}
344+
345+
/**
346+
* Get the underlying database connection.
347+
*
348+
* @return \Illuminate\Database\Connection
349+
*/
350+
public function getConnection()
351+
{
352+
return $this->connection;
353+
}
354+
355+
/**
356+
* Set the underlying database connection.
357+
*
358+
* @param \Illuminate\Database\Connection $connection
359+
* @return void
360+
*/
361+
public function setConnection(Connection $connection)
362+
{
363+
$this->connection = $connection;
364+
}
344365
}

0 commit comments

Comments
 (0)