-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
133 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Forrest79\PhPgSql\Db\ResultFactories; | ||
|
||
use Forrest79\PhPgSql\Db; | ||
use PgSql; | ||
|
||
class Basic implements Db\ResultFactory | ||
{ | ||
private Db\Connection $connection; | ||
|
||
private Db\Events $events; | ||
|
||
|
||
public function __construct(Db\Connection $connection, Db\Events $events) | ||
{ | ||
$this->connection = $connection; | ||
$this->events = $events; | ||
} | ||
|
||
|
||
public function createResult(PgSql\Result $resource, Db\Query $query): Db\Result | ||
{ | ||
$result = new Db\Result( | ||
$resource, | ||
$query, | ||
$this->connection->getDefaultRowFactory(), | ||
$this->connection->getDataTypeParser(), | ||
$this->connection->getDataTypesCache(), | ||
); | ||
|
||
$this->events->onResult($result); | ||
|
||
return $result; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Forrest79\PhPgSql\Db; | ||
|
||
use PgSql; | ||
|
||
interface ResultFactory | ||
{ | ||
|
||
function createResult(PgSql\Result $resource, Query $query): Result; | ||
|
||
} |