public function find($id = NULL)
{
if ($id !== NULL) {
$data = $this->getData();
$this->currentId = $id;
$this->currentKey = $this->getRowKey($id);
foreach ($data[$this->currentKey] as $field => $value) {
$this->set->{$field} = $value;
}
} else {
$this->limit(1)->findAll();
$data = $this->data;
if (count($data)) {
foreach ($data[0] as $field => $value) {
$this->set->{$field} = $value;
}
$this->currentId = $this->set->id;
$this->currentKey = $this->getRowKey($this->currentId);
}
}
return clone $this;
}