public function limit()
{
if (func_num_args() == 2) {
$this->option['limit'] = func_get_arg(1);
$this->option['offset'] = func_get_arg(0);
} elseif (func_num_args() == 1) {
$arg = func_get_arg(0);
if (!$this->validateParamater($arg)) {
return $this;
} elseif (is_array($arg)) {
if (count($arg) == 2) {
$this->option['offset'] = $arg[0];
$this->option['limit'] = $arg[1];
} else {
$this->option['limit'] = $arg[0];
}
} else {
$this->option['limit'] = $arg;
}
}
return $this;
}