Заявки на поединки. Начало.
This commit is contained in:
@@ -74,7 +74,7 @@ class Db
|
||||
// Allows the user to retrieve results using a
|
||||
// column from the results as a key for the array
|
||||
if (!is_null($key) && $results[0][$key]) {
|
||||
$keyed_results = array();
|
||||
$keyed_results = [];
|
||||
foreach ($results as $result) {
|
||||
$keyed_results[$result[$key]] = $result;
|
||||
}
|
||||
@@ -94,7 +94,7 @@ class Db
|
||||
return $stmt->fetch(PDO::FETCH_OBJ);
|
||||
}
|
||||
|
||||
public function ofetchAll($query, $values = null, $key = null): object
|
||||
public function ofetchAll($query, $values = null)
|
||||
{
|
||||
if (is_null($values)) {
|
||||
$values = [];
|
||||
@@ -102,18 +102,7 @@ class Db
|
||||
$values = [$values];
|
||||
}
|
||||
$stmt = $this->execute($query, $values);
|
||||
$results = $stmt->fetchAll(PDO::FETCH_OBJ);
|
||||
|
||||
// Allows the user to retrieve results using a
|
||||
// column from the results as a key for the array
|
||||
if (!is_null($key) && $results[0][$key]) {
|
||||
$keyed_results = (object)[];
|
||||
foreach ($results as $result) {
|
||||
$keyed_results->$result[$key] = $result;
|
||||
}
|
||||
$results = $keyed_results;
|
||||
}
|
||||
return $results;
|
||||
return $stmt->fetchAll(PDO::FETCH_OBJ);
|
||||
}
|
||||
|
||||
public function lastInsertId()
|
||||
|
||||
Reference in New Issue
Block a user