-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update 替换底层Connection 在查询事件结束时执行事件将$statement传递出去使用
该做法应能解决查询之后不能执行存储过程 & 方便转Json行为
Showing
3 changed files
with
1,244 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
|
||
declare(strict_types=1); | ||
/** | ||
* @author kvnZero | ||
* @contact kvnZero@github.com | ||
* @time 2021/12/4 5:25 下午 | ||
*/ | ||
|
||
namespace App\Event\ApiJson; | ||
|
||
class StatementComplete | ||
{ | ||
/** | ||
* The database connection instance. | ||
* | ||
* @var \Hyperf\Database\Connection | ||
*/ | ||
public $connection; | ||
|
||
/** | ||
* The PDO statement. | ||
* | ||
* @var \PDOStatement | ||
*/ | ||
public $statement; | ||
|
||
/** | ||
* Create a new event instance. | ||
* | ||
* @param \Hyperf\Database\Connection $connection | ||
* @param \PDOStatement $statement | ||
*/ | ||
public function __construct($connection, $statement) | ||
{ | ||
$this->statement = $statement; | ||
$this->connection = $connection; | ||
} | ||
} |
Oops, something went wrong.