1 | <?php |
||
12 | class Result { |
||
13 | |||
14 | /** |
||
15 | * @property bool $status the result status |
||
16 | * @property mysqli_result|bool $result the mysqli_result object for successful select queries, true for other queries, or false on failure |
||
17 | * @property string $query the query string |
||
18 | * @property float $time the query execution time in seconds |
||
19 | * |
||
20 | * @property int $rows a number of selected/affected rows |
||
21 | * @property int $id an updated id (auto-increment field) or zero if the id were not affected |
||
22 | * @property string $error an error description or an empty string if no error occurred |
||
23 | * @property int $errno an error code or zero if no error occurred |
||
24 | */ |
||
25 | |||
26 | private $status = false, $result = null, $query = '', $time = 0.0; |
||
27 | |||
28 | private $rows = 0, $id = 0, $error = '', $errno = 0; |
||
29 | |||
30 | /** |
||
31 | * Constructor |
||
32 | */ |
||
33 | |||
34 | public function __construct(\mysqli $link, $result, string $query, float $time) { |
||
52 | |||
53 | /** |
||
54 | * Get the next row |
||
55 | * |
||
56 | * @return the row data array or null if there are no more rows in the resultset |
||
57 | */ |
||
58 | |||
59 | public function getRow() { |
||
65 | |||
66 | /** |
||
67 | * Get the rows array |
||
68 | */ |
||
69 | |||
70 | public function getRows() : array { |
||
80 | |||
81 | /** |
||
82 | * Get a property |
||
83 | */ |
||
84 | |||
85 | public function __get(string $property) { |
||
89 | |||
90 | /** |
||
91 | * Check if a property exists |
||
92 | */ |
||
93 | |||
94 | public function __isset(string $property) : bool { |
||
98 | } |
||
99 | } |
||
100 |