Memcache, refactoring, View helpers, #16
git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/branches/evo@124 4cb57b5f-5bbd-dd11-951b-001d605cbbc5
This commit is contained in:
@ -34,31 +34,6 @@ abstract class DbStatement
|
||||
$this->sql = $sql;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $style
|
||||
* @return array
|
||||
*/
|
||||
public function fetchAll($style = Db::FETCH_OBJ)
|
||||
{
|
||||
$data = array();
|
||||
while ($row = $this->fetch($style)) {
|
||||
$data[] = $row;
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $field
|
||||
*/
|
||||
public function fetchField($field)
|
||||
{
|
||||
$row = $this->fetch(Db::FETCH_ASSOC);
|
||||
if (isset($row[$field])) {
|
||||
return $row[$field];
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function bindParam($param, &$value)
|
||||
{
|
||||
if ($this->map === null) {
|
||||
@ -138,6 +113,31 @@ abstract class DbStatement
|
||||
{
|
||||
$this->close();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $style
|
||||
* @return array
|
||||
*/
|
||||
public function fetchAll($style = Db::FETCH_OBJ)
|
||||
{
|
||||
$data = array();
|
||||
while ($row = $this->fetch($style)) {
|
||||
$data[] = $row;
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $field
|
||||
*/
|
||||
public function fetchField($field)
|
||||
{
|
||||
$row = $this->fetch(Db::FETCH_ASSOC);
|
||||
if (isset($row[$field])) {
|
||||
return $row[$field];
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Abstract methods */
|
||||
|
||||
|
Reference in New Issue
Block a user