public static function fetch(
      $where,
      array $fields = null,
      string $orderField = null,
      string $orderDirection = null,
      int $limit = null,
      int $start = null
    ): array {
        $select = static::select();

        if ($fields !== null) {
            $select->fields($fields);
        }

        if ($where instanceof Where) {
            $select->where(clone $where);
        } else if (is_array($where)) {
            foreach ($where as $field => $value) {
                $select->where($field, $value);
            }
        } else if (!is_array(static::$primaryKey) && (is_numeric($where) || is_string($where))) {
            $select->where(static::$primaryKey, $where);
        }

        if ($orderField !== null) {
            $select->orderBy($orderField, $orderDirection);
        }

        if ($limit !== null) {
            $select->limit($start ?? 0, $limit);
        }

        $data = [];
        foreach ($select->fetchAll() as $r) {
            $data[] = new static($r);
        }

        return $data;
    }