1 | <?php |
||
12 | trait FetchModeTrait { |
||
13 | /** |
||
14 | * @var array The fetch arguments (if any). |
||
15 | */ |
||
16 | private $fetchArgs = [PDO::FETCH_ASSOC]; |
||
17 | |||
18 | /** |
||
19 | * Get the default fetch mode. |
||
20 | * |
||
21 | * @return int Returns the current fetch mode. |
||
22 | */ |
||
23 | 17 | public function getFetchMode() { |
|
26 | |||
27 | /** |
||
28 | * Get the fetch arguments. |
||
29 | * |
||
30 | * @return array Returns an array of arguments including the fetch mode. |
||
31 | */ |
||
32 | 83 | public function getFetchArgs() { |
|
35 | |||
36 | /** |
||
37 | * Set the default fetch mode. |
||
38 | * |
||
39 | * @param int|string $mode One of the **PDO::FETCH_*** constants or a class name. |
||
40 | * @param array $args Additional arguments for {@link \PDOStatement::fetchAll()}. |
||
41 | * @return $this |
||
42 | * @see http://php.net/manual/en/pdostatement.fetchall.php |
||
43 | */ |
||
44 | 17 | public function setFetchMode($mode, ...$args) { |
|
53 | } |
||
54 |