protected function toSql($fields=null) : QueryBuilder
	{
		$queryBuilder = $this->queryBuilder()
		->select($fields)
		->from($this->table);

		$orderBy = [];

		if (isset(Model::$findOptions['asc'])) {
			$orderBy[] = Model::$findOptions['asc'] . ' ASC';
		}

		if (isset(Model::$findOptions['desc'])) {
			$orderBy[] = Model::$findOptions['desc'] . ' DESC';
		}

		if (!empty($orderBy)) {
			$queryBuilder->orderBy($orderBy);
		}

		if (isset(Model::$findOptions['limit'])) {
			$limit = Model::$findOptions['limit'];

			if (is_array($limit) && count($limit) > 1) {
				$queryBuilder->limit($limit[0], $limit[1]);
			}else{
				$queryBuilder->limit($limit);
			}
		}

		return $queryBuilder;
	}