Правки namespace
This commit is contained in:
parent
ee06f1febb
commit
524b27936a
39 changed files with 141 additions and 120 deletions
|
|
@ -3,6 +3,7 @@
|
|||
namespace ctiso\Database;
|
||||
|
||||
use ctiso\Database\StatementIterator,
|
||||
ctiso\Tools\StringUtil,
|
||||
PDO;
|
||||
|
||||
class PDOStatement extends \PDOStatement implements \IteratorAggregate
|
||||
|
|
@ -91,7 +92,7 @@ class PDOStatement extends \PDOStatement implements \IteratorAggregate
|
|||
}
|
||||
|
||||
function getArray($name) {
|
||||
return strToArray($this->fields[$name]);
|
||||
return StringUtil::strToArray($this->fields[$name]);
|
||||
}
|
||||
|
||||
function getRecordCount() {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@
|
|||
* Класс оболочка для PDOStatement для замены Creole
|
||||
*/
|
||||
namespace ctiso\Database;
|
||||
use PDO;
|
||||
use PDO,
|
||||
ctiso\Database;
|
||||
|
||||
class Statement
|
||||
{
|
||||
|
|
@ -50,7 +51,7 @@ class Statement
|
|||
if ($this->limit) {
|
||||
$this->query .= " LIMIT {$this->limit} OFFSET {$this->offset}";
|
||||
}
|
||||
/*.Database_PDOStatement.*/$stmt = $this->conn->prepare($this->query);
|
||||
/*.PDOStatement.*/$stmt = $this->conn->prepare($this->query);
|
||||
foreach ($this->binds as $bind) {
|
||||
list($n, $value, $type) = $bind;
|
||||
$stmt->bindValue($n, $value, (int) $type);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
namespace ctiso\Database;
|
||||
use PDO;
|
||||
|
||||
class StatementIterator implements Iterator
|
||||
class StatementIterator implements \Iterator
|
||||
{
|
||||
|
||||
private $result;
|
||||
|
|
@ -11,7 +11,7 @@ class StatementIterator implements Iterator
|
|||
private $fetchmode;
|
||||
private $row_count;
|
||||
|
||||
public function __construct(/*.Database_PDOStatement.*/ $rs) {
|
||||
public function __construct(/*.PDOStatement.*/ $rs) {
|
||||
$this->result = $rs;
|
||||
$this->row_count = $rs->getRecordCount();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue