protected function getOne($fields = null)
{
$this->processHasOneWith();
$results = $this->db->ArrayBuilder()->getOne($this->dbTable, $fields);
if ($this->db->count == 0) {
return null;
}
$this->processArrays($results);
$this->data = $results;
$this->processAllWith($results);
if ($this->returnType == 'Json') {
return json_encode($results);
}
if ($this->returnType == 'Array') {
return $results;
}
$item = new static($results);
$item->isNew = false;
return $item;
}