public function count()
	{
		//get the limit clause value
		$limit = $this->limits;

		//get the offset value
		$limitOffset = $this->offset;

		//get the fields clause
		$fields = $this->fields;

		//compose the fields array
		$this->fields = array($this->froms => array("COUNT(1)" => "rows"));

		//set limit to 1
		$this->limit(1);

		//get the first row
		$row = $this->first()->result_array();

		//set the value of the fields
		$this->fields = $fields;

		//check if fields is defined
		if ( $fields ) 
		{
			//set the value o fields
			$this->fields = $fields;

		}

		//check if the limit value is set
		if ( $limit ) 
		{
			//set the value of limit
			$this->limits = $limit;

		}

		//check if the limit offset value is defined
		if ( $limitOffset ) 
		{
			//set the offset value
			$this->offset = $limitOffset;

		}

		//get the response object instance
		$this->responseObject 
			->setNumRows($row[0]['rows'])
			->setResultArray($row);

		//return the full response object
		return $this->responseObject;

	}