DIGITEC-314 Ошибка скрипта импорта
Создан интерфейс для классов SqlResultProvider и SqlResultCollection. В последний добавлены недостающие метода
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
class SqlResultCollection extends ArrayIterator
|
||||
class SqlResultCollection extends ArrayIterator implements iSqlResultItems
|
||||
{
|
||||
private $items;
|
||||
|
||||
@ -12,8 +12,29 @@ class SqlResultCollection extends ArrayIterator
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return DbStatement[]
|
||||
*/
|
||||
public function fetchAll()
|
||||
{
|
||||
return $this->items;
|
||||
return (array) $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $field
|
||||
* @return mixed
|
||||
*/
|
||||
public function fetchField($field)
|
||||
{
|
||||
$item = $this->offsetGet(0);
|
||||
return $item->{$field};
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function fetch()
|
||||
{
|
||||
return $this->offsetGet(0);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user