File tree Expand file tree Collapse file tree 4 files changed +6
-5
lines changed Expand file tree Collapse file tree 4 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -23,10 +23,9 @@ function fetch(): ?IRow;
2323
2424 /**
2525 * Fetches single field.
26- * @param int|string
2726 * @return mixed
2827 */
29- function fetchField ($ column = 0 );
28+ function fetchField ();
3029
3130 /**
3231 * Fetches all rows as associative array.
Original file line number Diff line number Diff line change @@ -252,6 +252,9 @@ public function fetch(): ?IRow
252252 */
253253 public function fetchField ($ column = 0 )
254254 {
255+ if (func_num_args ()) {
256+ trigger_error (__METHOD__ . '() argument is deprecated. ' , E_USER_DEPRECATED );
257+ }
255258 $ row = $ this ->fetch ();
256259 return $ row ? $ row [$ column ] : null ;
257260 }
Original file line number Diff line number Diff line change @@ -209,8 +209,9 @@ public function fetch(): ?Nette\Database\IRow
209209 * Fetches single field.
210210 * @param string|null
211211 * @return mixed
212+ * @deprecated
212213 */
213- public function fetchField ($ column = null )
214+ public function fetchField (string $ column = null )
214215 {
215216 if ($ column ) {
216217 $ this ->select ($ column );
Original file line number Diff line number Diff line change @@ -18,8 +18,6 @@ test(function () use ($connection) {
1818 $ res = $ connection ->query ('SELECT name, id FROM author ORDER BY id ' );
1919
2020 Assert::same ('Jakub Vrana ' , $ res ->fetchField ());
21- Assert::same (12 , $ res ->fetchField (1 ));
22- Assert::same ('Geek ' , $ res ->fetchField ('name ' ));
2321});
2422
2523
You can’t perform that action at this time.
0 commit comments