eee
This commit is contained in:
+2
-7
@@ -14,7 +14,6 @@ use Exception;
|
|||||||
use Kiri\Abstracts\Component;
|
use Kiri\Abstracts\Component;
|
||||||
use Kiri\Di\Container;
|
use Kiri\Di\Container;
|
||||||
use PDO;
|
use PDO;
|
||||||
use PDOStatement;
|
|
||||||
use Throwable;
|
use Throwable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -28,7 +27,6 @@ class Command extends Component
|
|||||||
public ?string $sql = '';
|
public ?string $sql = '';
|
||||||
public array $params = [];
|
public array $params = [];
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $params
|
* @param array $params
|
||||||
* @throws
|
* @throws
|
||||||
@@ -123,13 +121,10 @@ class Command extends Component
|
|||||||
throw new Exception('(' . $prepare->errorInfo()[0] . ')' . $client->errorInfo()[2]);
|
throw new Exception('(' . $prepare->errorInfo()[0] . ')' . $client->errorInfo()[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$prepare->execute($this->params);
|
$result = $method == 'rowCount' ? $prepare->rowCount() : $prepare->{$method}(PDO::FETCH_ASSOC);
|
||||||
$prepare->closeCursor();
|
$prepare->closeCursor();
|
||||||
|
|
||||||
if ($method == 'rowCount') {
|
return $result;
|
||||||
return $prepare->rowCount();
|
|
||||||
}
|
|
||||||
return $prepare->{$method}(PDO::FETCH_ASSOC);
|
|
||||||
} catch (Throwable $throwable) {
|
} catch (Throwable $throwable) {
|
||||||
if ($this->isRefresh($throwable)) {
|
if ($this->isRefresh($throwable)) {
|
||||||
return $this->search($method);
|
return $this->search($method);
|
||||||
|
|||||||
Reference in New Issue
Block a user