Controller for validating type facets.
More...
#include <facetscontroller.h>
|
| | FacetsController (const RecordsController &recordsController, const TypesController &typesController) |
| | Constructs a new controller for validating type facets. More...
|
| |
| QList< Facet * > | getFacets (const QString &targetType) const |
| | Gets a list of all facets that may apply to the specified type. More...
|
| |
| QVariant | getFacetValue (const QString &fieldType, const QString &facetKey) const |
| | Gets the restriction of the specified domain of the specified type (e.g. minimum value of an integer). More...
|
| |
| void | registerFacet (Facet *facet) |
| | Adds a new facet to be applied to custom types. More...
|
| |
| QString | validateFieldValue (const QString &fieldType, const QVariant &fieldValue) const |
| | Validates the specified field value against the domain restrictions imposed by the facets of its type. More...
|
| |
Controller for validating type facets.
◆ FacetsController()
Constructs a new controller for validating type facets.
- Parameters
-
| recordsController | Controller for adding, updating and removing records. |
| typesController | Controller for adding, updating and removing custom types. |
◆ getFacets()
| QList< Facet * > FacetsController::getFacets |
( |
const QString & |
targetType | ) |
const |
Gets a list of all facets that may apply to the specified type.
- Parameters
-
| targetType | Type to get all facets for. |
- Returns
- List of all facets that may apply to the specified type.
◆ getFacetValue()
| QVariant FacetsController::getFacetValue |
( |
const QString & |
fieldType, |
|
|
const QString & |
facetKey |
|
) |
| const |
Gets the restriction of the specified domain of the specified type (e.g. minimum value of an integer).
- Parameters
-
| fieldType | Type to get the restriction of. |
| facetKey | Restriction to get. |
- Returns
- Restriction of the specified domain of the specified type.
◆ registerFacet()
| void FacetsController::registerFacet |
( |
Tome::Facet * |
facet | ) |
|
Adds a new facet to be applied to custom types.
- Parameters
-
◆ validateFieldValue()
| QString FacetsController::validateFieldValue |
( |
const QString & |
fieldType, |
|
|
const QVariant & |
fieldValue |
|
) |
| const |
Validates the specified field value against the domain restrictions imposed by the facets of its type.
- Parameters
-
| fieldType | Type of the field value to validate. |
| fieldValue | Field value to validate. |
- Returns
- Translated error message, if any validation errors occur, and an empty string otherwise.
The documentation for this class was generated from the following files:
- Source/Tome/Features/Facets/Controller/facetscontroller.h
- Source/Tome/Features/Facets/Controller/facetscontroller.cpp