DIGITEC-314 Ошибка скрипта импорта

Создан интерфейс для классов SqlResultProvider и SqlResultCollection. В последний добавлены недостающие метода
This commit is contained in:
Alexander Demidov
2014-03-13 12:39:44 +04:00
parent 6b0bf4058e
commit 5f9c295c01
3 changed files with 51 additions and 14 deletions

View File

@ -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);
}
}