ci4
1<?php
2
3declare(strict_types=1);4
5/**
6* This file is part of CodeIgniter 4 framework.
7*
8* (c) CodeIgniter Foundation <admin@codeigniter.com>
9*
10* For the full copyright and license information, please view
11* the LICENSE file that was distributed with this source code.
12*/
13
14namespace CodeIgniter\Database;15
16use BadMethodCallException;17
18/**
19* @template TConnection
20* @template TStatement
21* @template TResult
22*/
23interface PreparedQueryInterface24{
25/**26* Takes a new set of data and runs it against the currently
27* prepared query. Upon success, will return a Results object.
28*
29* @return bool|ResultInterface
30* @phpstan-return bool|ResultInterface<TConnection, TResult>
31*/
32public function execute(...$data);33
34/**35* Prepares the query against the database, and saves the connection
36* info necessary to execute the query later.
37*
38* @return $this
39*/
40public function prepare(string $sql, array $options = []);41
42/**43* Explicity closes the statement.
44*
45* @throws BadMethodCallException
46*/
47public function close(): bool;48
49/**50* Returns the SQL that has been prepared.
51*/
52public function getQueryString(): string;53
54/**55* Returns the error code created while executing this statement.
56*/
57public function getErrorCode(): int;58
59/**60* Returns the error message created while executing this statement.
61*/
62public function getErrorMessage(): string;63}
64