| Total Complexity | 4 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 4 | class Query extends DatabaseItem implements Commitable, Initializable |
||
| 5 | { |
||
| 6 | private string $query; |
||
| 7 | private array $bindData; |
||
| 8 | private array $queryData; |
||
| 9 | |||
| 10 | |||
| 11 | public function __construct(string $query, array $bindData = []) |
||
| 12 | { |
||
| 13 | $this->query = $query; |
||
| 14 | $this->bindData = $bindData; |
||
| 15 | } |
||
| 16 | |||
| 17 | #[\Override] |
||
| 18 | public function initialize(): void |
||
| 19 | { |
||
| 20 | $this->queryData = [ |
||
| 21 | 'query' => $this->query, |
||
| 22 | 'bind' => $this->bindData |
||
| 23 | ]; |
||
| 24 | $this->new = true; |
||
| 25 | } |
||
| 26 | |||
| 27 | public function rollback(string $query, array $bindData = []): DatabaseItem |
||
| 28 | { |
||
| 29 | $this->queryData['rollback_query'] = $query; |
||
| 30 | $this->queryData['rollback_bind'] = $bindData; |
||
| 31 | $this->new = true; |
||
| 32 | return $this; |
||
| 33 | } |
||
| 34 | |||
| 35 | #[\Override] |
||
| 39 | } |
||
| 40 | } |
||
| 41 |