Class FieldOptionService
- Namespace
- Dynamicweb.Ecommerce.Products
- Assembly
- Dynamicweb.Ecommerce.dll
public class FieldOptionService : ICacheStorage<string, FieldOption>, ICacheStorage<string>, ICacheStorage
- Inheritance
-
FieldOptionService
- Implements
- Inherited Members
Constructors
FieldOptionService()
public FieldOptionService()
Methods
ClearCache()
Resets all keys to the default value for objects stored in the object cache
public void ClearCache()
ClearCache(IEnumerable<string>)
Resets the specified keys to the default value for objects stored in the object cache
public void ClearCache(IEnumerable<string> keys)
Parameters
keysIEnumerable<string>- Keys to reset
ClearCache(string)
Resets the specified key to the default value for objects stored in the object cache
public void ClearCache(string key)
Parameters
keystring- Key to reset
ClearCacheByFieldId(string)
public void ClearCacheByFieldId(string fieldId)
Parameters
fieldIdstring
Copy(FieldOption)
Retrieves shallow copy of the current object.
public FieldOption Copy(FieldOption option)
Parameters
optionFieldOption
Returns
- FieldOption
- Shallow copy of the current object.
Delete(string)
Deletes specified option.
public void Delete(string optionId)
Parameters
optionIdstring- An ID of the option to delete.
DeleteAll(string)
Deletes all options that belongs to specified field.
public void DeleteAll(string fieldId)
Parameters
fieldIdstring- An ID of either a product field or a product group field.
DeleteByIds(IEnumerable<string>, string)
public void DeleteByIds(IEnumerable<string> ids, string languageId)
Parameters
idsIEnumerable<string>languageIdstring
DeleteExcessOptionTranslations()
public void DeleteExcessOptionTranslations()
DeleteFieldOptionTranslations(string)
public void DeleteFieldOptionTranslations(string fieldId)
Parameters
fieldIdstring
DeleteFieldOptionTranslations(string, string)
public void DeleteFieldOptionTranslations(string fieldId, string languageId)
Parameters
DeleteTranslation(int)
public void DeleteTranslation(int id)
Parameters
idint
GetOptionById(string)
Retrieves an option from by its ID.
public FieldOption GetOptionById(string optionId)
Parameters
optionIdstring- An ID of the option.
Returns
- FieldOption
- Option instance or null (Nothing in Visual Basic) if the specified option can not be found.
GetOptionsByFieldId(string)
Retrieves a collection of options that matches specified field ID.
public FieldOptionCollection GetOptionsByFieldId(string fieldId)
Parameters
fieldIdstring- An ID of the field.
Returns
- FieldOptionCollection
- A collection of options that matches specified field ID.
Remarks
The resulting collection is sorted ascending by the sort number.
GetTranslation(string, string)
[Obsolete("Use FieldOption.Translations property instead.")]
public FieldOptionTranslation GetTranslation(string optionId, string languageId)
Parameters
Returns
MaximumSort(string)
Retrieves the maximum sort number for options that matches specified field ID.
public int MaximumSort(string fieldId)
Parameters
fieldIdstring- An ID of the field.
Returns
- int
- The maximum sort number for options that matches specified field ID.
MinimumSort(string)
Retrieves the minimum sort number for options that matches specified field ID.
public int MinimumSort(string fieldId)
Parameters
fieldIdstring- An ID of the field.
Returns
- int
- The minimum sort number for options that matches specified field ID.
Save(FieldOption)
Saves an option.
public void Save(FieldOption option)
Parameters
optionFieldOption
SaveOptions(IEnumerable<FieldOption>)
public void SaveOptions(IEnumerable<FieldOption> options)
Parameters
optionsIEnumerable<FieldOption>
SaveTranslation(FieldOptionTranslation)
public void SaveTranslation(FieldOptionTranslation fieldOptionTranslation)
Parameters
fieldOptionTranslationFieldOptionTranslation