public static function isUnique(
      string $field,
      $value,
      $exceptionValue = null,
      string $exceptionField = null
    ): bool {
        $select = static::select();
        $select->field('COUNT(*)', 'total')->where($field, $value);

        if ($exceptionValue !== null) {
            if ($exceptionField === null) {
                $exceptionField = $field;
            }

            $select->where($exceptionField, '!=', $exceptionValue);
        }

        $results = $select->fetchAll();

        if (isset($results[0])) {
            return ($results[0]['total'] == 0);
        }

        return true;
    }