code: function(value) {
          if (value === null) {
              return [];
          } else if (Array.isArray(value)) {
              if (value.every(Selectivity.isValidId)) {
                  return value;
              } else {
                  throw new Error('Value contains invalid IDs');
              }
          } else {
              throw new Error('Value for MultiSelectivity instance should be an array');
          }
      }
docs: Validates a value to set. Throws an exception if the value is invalid.
  
  @param value The value to validate. Should be an array of IDs.
  
  @return The validated value. This may differ from the input value.