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
keys
IEnumerable<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
key
string- Key to reset
ClearCacheByFieldId(string)
public void ClearCacheByFieldId(string fieldId)
Parameters
fieldId
string
Copy(FieldOption)
Retrieves shallow copy of the current object.
public FieldOption Copy(FieldOption option)
Parameters
option
FieldOption
Returns
- FieldOption
- Shallow copy of the current object.
Delete(string)
Deletes specified option.
public void Delete(string optionId)
Parameters
optionId
string- An ID of the option to delete.
DeleteAll(string)
Deletes all options that belongs to specified field.
public void DeleteAll(string fieldId)
Parameters
fieldId
string- 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
ids
IEnumerable<string>languageId
string
DeleteExcessOptionTranslations()
public void DeleteExcessOptionTranslations()
DeleteFieldOptionTranslations(string)
public void DeleteFieldOptionTranslations(string fieldId)
Parameters
fieldId
string
DeleteFieldOptionTranslations(string, string)
public void DeleteFieldOptionTranslations(string fieldId, string languageId)
Parameters
DeleteTranslation(int)
public void DeleteTranslation(int id)
Parameters
id
int
GetOptionById(string)
Retrieves an option from by its ID.
public FieldOption GetOptionById(string optionId)
Parameters
optionId
string- 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
fieldId
string- 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
fieldId
string- 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
fieldId
string- 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
option
FieldOption
SaveOptions(IEnumerable<FieldOption>)
public void SaveOptions(IEnumerable<FieldOption> options)
Parameters
options
IEnumerable<FieldOption>
SaveTranslation(FieldOptionTranslation)
public void SaveTranslation(FieldOptionTranslation fieldOptionTranslation)
Parameters
fieldOptionTranslation
FieldOptionTranslation