public function take($limit = null) { // Only positive integers are allowed if (!is_int($limit) || $limit < 0 || !$limit) { $limit = 0; } $this->setState('limit', $limit); return $this; }