cassell/SQLicious — Issue #29: Generate DataArrayProcessor classes
Author: cassell
Created: 2012-02-28 23:01:23+00:00
State: open

query();

$data = array();

$this->process(function($row) use (&$data)
{
$data[] = $row;
});

$this->freeResult();

return $data;
}

function getJSON()
{
$this->query();

$data = array();

$this->process(function($row) use (&$data)
{
$j = array();
if($row != null)
{
foreach($row as $field => $value)
{
$j[DataAccessObjectFactory::toFieldCase($field)] = $value;
}
}
$data[] = $j;
});

$this->freeResult();

return $data;
}

function loadObject($row)
{
return $row;
}

function setSql($val) { $this->sql = $val; }
function getSql() { return $this->sql; }

function getObjects()
{
die("getObjects is not available in data processors");
}
function getTableName()
{
die("getTableName is not available in data processors");
}
function getIdField()
{
die("getIdField is not available in data processors");
}
function getFields()
{
return $this->fields;
}

}

?>