Search:

# CWIS Developers Documentation

Public Member Functions | Static Public Member Functions | Public Attributes

# MetadataSchema Class Reference

Collaboration diagram for MetadataSchema:
[legend]

## Public Member Functions
| MetadataSchema ()
| CacheData ($NewValue)
| AddField ($FieldName, $FieldType, $Optional=TRUE, $DefaultValue=NULL)
| DropField ($FieldId)
| GetField ($FieldId)
| GetFieldByName ($FieldName, $IgnoreCase=FALSE)
| Retrieve metadata field by name.
| GetFieldIdByName ($FieldName, $IgnoreCase=FALSE)
| Retrieve metadata field ID by name.
| FieldExists ($FieldName)
| GetFields ($FieldTypes=NULL, $OrderType=NULL, $IncludeDisabledFields=FALSE, $IncludeTempFields=FALSE)
| CompareFieldOrder ($FieldA, $FieldB)
| GetFieldNames ($FieldTypes=NULL, $OrderType=NULL, $IncludeDisabledFields=FALSE, $IncludeTempFields=FALSE)
| GetFieldsAsOptionList ($OptionListName, $FieldTypes=NULL, $SelectedFieldId=NULL)
| Retrieve fields of specified type as HTML option list with field names as labels and field IDs as value attributes.
| GetFieldTypes ()
| GetAllowedFieldTypes ()
| RemoveQualifierAssociations ($QualifierIdOrObject)
| QualifierIsInUse ($QualifierIdOrObject)
| MoveUpInOrder ($FieldIdOrObj, $OrderType)
| MoveDownInOrder ($FieldIdOrObj, $OrderType)
| GetHighestFieldId ()
| GetFieldByMappedName ($MappedName)
| Get field by standard field name.
## Static Public Member Functions
static | StdNameToFieldMapping ($MappedName, $FieldId=NULL)
| Get/set mapping of standard field name to specific field.
static | FieldToStdNameMapping ($FieldId)
| Get mapping of field ID to standard field name.
## Public Attributes
const | MDFORDER_DISPLAY = 1
const | MDFORDER_EDITING = 2
const | MDFORDER_ALPHABETICAL = 3
const | MDFTYPE_TEXT = 1
const | MDFTYPE_PARAGRAPH = 2
const | MDFTYPE_NUMBER = 4
const | MDFTYPE_DATE = 8
const | MDFTYPE_TIMESTAMP = 16
const | MDFTYPE_FLAG = 32
const | MDFTYPE_TREE = 64
const | MDFTYPE_CONTROLLEDNAME = 128
const | MDFTYPE_OPTION = 256
const | MDFTYPE_USER = 512
const | MDFTYPE_IMAGE = 1024
const | MDFTYPE_FILE = 2048
const | MDFTYPE_URL = 4096
const | MDFTYPE_POINT = 8192
const | MDFSTAT_OK = 1
const | MDFSTAT_DUPLICATENAME = 2
const | MDFSTAT_DUPLICATEDBCOLUMN = 4
const | MDFSTAT_ILLEGALNAME = 8
const | MDFSTAT_FIELDDOESNOTEXIST = 16

List of all members.

## Detailed Description

Definition at line 10 of file MetadataSchema.php.

Inheritance diagram for MetadataSchema:
[legend]

## Member Function Documentation

MetadataSchema::AddField | ( | $ | FieldName,
|  | $ | FieldType,
|  | $ | Optional = `TRUE`,
|  | $ | DefaultValue = `NULL`
| ) |  |

Definition at line 62 of file MetadataSchema.php.

References MDFSTAT_OK.

MetadataSchema::CacheData | ( | $ | NewValue ) |

Definition at line 56 of file MetadataSchema.php.

MetadataSchema::CompareFieldOrder | ( | $ | FieldA,
|  | $ | FieldB
| ) |  |

Definition at line 205 of file MetadataSchema.php.

References MDFORDER_ALPHABETICAL.

MetadataSchema::DropField | ( | $ | FieldId ) |

Definition at line 79 of file MetadataSchema.php.

References ItemFactory::$FieldId.

MetadataSchema::FieldExists | ( | $ | FieldName ) |

Definition at line 139 of file MetadataSchema.php.

References ItemFactory::NameIsInUse().

static MetadataSchema::FieldToStdNameMapping | ( | $ | FieldId ) | `[static]`

Get mapping of field ID to standard field name.

Parameters:

  FieldId | Field ID.

Returns:
  Standard field name to which specified field is mapped, or NULL if field is not currently mapped.

Definition at line 360 of file MetadataSchema.php.

References ItemFactory::$FieldId.

MetadataSchema::GetAllowedFieldTypes | ( | ) |

Definition at line 286 of file MetadataSchema.php.

References MetadataField::$FieldTypeDBAllowedEnums.

MetadataSchema::GetField | ( | $ | FieldId ) |

Definition at line 86 of file MetadataSchema.php.

References ItemFactory::$FieldId.

Referenced by GetFieldByMappedName(), GetFieldByName(), and SPTOAIItemFactory::SearchForItems().

Here is the caller graph for this function:

MetadataSchema::GetFieldByMappedName | ( | $ | MappedName ) |

Get field by standard field name.

Parameters:

  MappedName | Standard field name.

Returns:
  MetadataField to which standard field name is mapped or NULL if specified standard field name is not currently mapped or mapped field does not exist.

Definition at line 379 of file MetadataSchema.php.

References GetField(), and StdNameToFieldMapping().

MetadataSchema::GetFieldByName | ( | $ | FieldName,
|  | $ | IgnoreCase = `FALSE`
| ) |  |

Retrieve metadata field by name.

Parameters:

  FieldName | Field name.
  IgnoreCase | If TRUE, case is ignore when matching field names.

Returns:
  Requested MetadataField or NULL if no field found with specified name.

Definition at line 107 of file MetadataSchema.php.

References ItemFactory::$FieldId, GetField(), and GetFieldIdByName().

MetadataSchema::GetFieldIdByName | ( | $ | FieldName,
|  | $ | IgnoreCase = `FALSE`
| ) |  |

Retrieve metadata field ID by name.

Parameters:

  FieldName | Field name.
  IgnoreCase | If TRUE, case is ignore when matching field names.

Returns:
  ID of requested MetadataField or FALSE if no field found with specified name.

Definition at line 120 of file MetadataSchema.php.

Referenced by GetFieldByName().

Here is the caller graph for this function:

MetadataSchema::GetFieldNames | ( | $ | FieldTypes = `NULL`,
|  | $ | OrderType = `NULL`,
|  | $ | IncludeDisabledFields = `FALSE`,
|  | $ | IncludeTempFields = `FALSE`
| ) |  |

Definition at line 227 of file MetadataSchema.php.

References ItemFactory::$DB, and GetFields().

Referenced by GetFieldsAsOptionList().

Here is the caller graph for this function:

MetadataSchema::GetFields | ( | $ | FieldTypes = `NULL`,
|  | $ | OrderType = `NULL`,
|  | $ | IncludeDisabledFields = `FALSE`,
|  | $ | IncludeTempFields = `FALSE`
| ) |  |

Definition at line 142 of file MetadataSchema.php.

References MetadataField::$FieldTypePHPEnums.

Referenced by GetFieldNames().

Here is the caller graph for this function:

MetadataSchema::GetFieldsAsOptionList | ( | $ | OptionListName,
|  | $ | FieldTypes = `NULL`,
|  | $ | SelectedFieldId = `NULL`
| ) |  |

Retrieve fields of specified type as HTML option list with field names as labels and field IDs as value attributes.

The first element on the list will have a label of "--" and an ID of -1 to indicate no field selected.

Parameters:

  OptionListName | Value of option list "name" attribute.
  FieldTypes | Types of fields to return. (OPTIONAL - use NULL for all types)
  SelectedFieldId | ID of currently-selected field. (OPTIONAL)

Returns:
  HTML for option list.

Definition at line 253 of file MetadataSchema.php.

References GetFieldNames().

MetadataSchema::GetFieldTypes | ( | ) |

Definition at line 280 of file MetadataSchema.php.

References MetadataField::$FieldTypeDBEnums.

MetadataSchema::GetHighestFieldId | ( | ) |

Definition at line 335 of file MetadataSchema.php.

References ItemFactory::GetHighestItemId().

MetadataSchema::MetadataSchema | ( | ) |

Definition at line 45 of file MetadataSchema.php.

References ItemFactory::ItemFactory().

MetadataSchema::MoveDownInOrder | ( | $ | FieldIdOrObj,
|  | $ | OrderType
| ) |  |

Definition at line 329 of file MetadataSchema.php.

MetadataSchema::MoveUpInOrder | ( | $ | FieldIdOrObj,
|  | $ | OrderType
| ) |  |

Definition at line 325 of file MetadataSchema.php.

MetadataSchema::QualifierIsInUse | ( | $ | QualifierIdOrObject ) |

Definition at line 304 of file MetadataSchema.php.

MetadataSchema::RemoveQualifierAssociations | ( | $ | QualifierIdOrObject ) |

Definition at line 292 of file MetadataSchema.php.

static MetadataSchema::StdNameToFieldMapping | ( | $ | MappedName,
|  | $ | FieldId = `NULL`
| ) |  | `[static]`

Get/set mapping of standard field name to specific field.

Parameters:

  MappedName | Standard field name.
  FieldId | ID of field to map to. (OPTIONAL)

Returns:
  ID of field to which standard field name is mapped or NULL if specified standard field name is not currently mapped.

Definition at line 344 of file MetadataSchema.php.

References ItemFactory::$FieldId.

Referenced by GetFieldByMappedName().

Here is the caller graph for this function:

## Member Data Documentation

const MetadataSchema::MDFORDER_ALPHABETICAL = 3

Definition at line 17 of file MetadataSchema.php.

Referenced by CompareFieldOrder().

const MetadataSchema::MDFORDER_DISPLAY = 1

Definition at line 15 of file MetadataSchema.php.

Referenced by MetadataField::MetadataField(), and MetadataField::OrderPosition().

const MetadataSchema::MDFORDER_EDITING = 2

Definition at line 16 of file MetadataSchema.php.

Referenced by MetadataField::MetadataField(), and MetadataField::OrderPosition().

const MetadataSchema::MDFSTAT_DUPLICATEDBCOLUMN = 4

Definition at line 40 of file MetadataSchema.php.

const MetadataSchema::MDFSTAT_DUPLICATENAME = 2

Definition at line 39 of file MetadataSchema.php.

Referenced by MetadataField::MetadataField(), and MetadataField::Name().

const MetadataSchema::MDFSTAT_FIELDDOESNOTEXIST = 16

Definition at line 42 of file MetadataSchema.php.

Referenced by MetadataField::MetadataField().

const MetadataSchema::MDFSTAT_ILLEGALNAME = 8

Definition at line 41 of file MetadataSchema.php.

Referenced by MetadataField::IsTempItem(), and MetadataField::Name().

const MetadataSchema::MDFSTAT_OK = 1

Definition at line 38 of file MetadataSchema.php.

Referenced by AddField(), Resource::Get(), Resource::GetQualifierByField(), ResourceFactory::GetResourceCount(), MetadataField::MetadataField(), and MetadataField::Name().

const MetadataSchema::MDFTYPE_CONTROLLEDNAME = 128

Definition at line 29 of file MetadataSchema.php.

Referenced by MetadataField::AddDatabaseFields(), Resource::ClearByField(), MetadataField::Drop(), Resource::Get(), MetadataField::GetAllowedConversionTypes(), MetadataField::GetCountOfPossibleValues(), MetadataField::GetFactory(), MetadataField::GetIdForValue(), MetadataField::GetPossibleValues(), Resource::GetQualifierByField(), ResourceFactory::GetResourceCount(), SPTOAIItem::GetSets(), MetadataField::GetValueForId(), SPTOAIItemFactory::LoadSetNameInfo(), MetadataField::ModifyField(), SPTSearchEngine::SearchFieldForPhrases(), SPTSearchEngine::SearchFieldsForComparisonMatches(), Resource::Set(), SPTRecommender::SPTRecommender(), and SPTSearchEngine::SPTSearchEngine().

const MetadataSchema::MDFTYPE_DATE = 8

Definition at line 25 of file MetadataSchema.php.

Referenced by MetadataField::AddDatabaseFields(), Resource::ClearByField(), MetadataField::Drop(), Resource::Get(), MetadataField::GetAllowedConversionTypes(), ResourceFactory::GetMatchingResources(), ResourceFactory::GetResourceIdsSortedBy(), MetadataField::ModifyField(), SPTSearchEngine::SearchFieldForPhrases(), SPTSearchEngine::SearchFieldsForComparisonMatches(), Resource::Set(), SPTRecommender::SPTRecommender(), and SPTSearchEngine::SPTSearchEngine().

const MetadataSchema::MDFTYPE_FILE = 2048

Definition at line 33 of file MetadataSchema.php.

Referenced by MetadataField::AddDatabaseFields(), Resource::ClearByField(), MetadataField::Drop(), Resource::Get(), MetadataField::GetAllowedConversionTypes(), MetadataField::ModifyField(), SPTSearchEngine::SearchFieldForPhrases(), SPTSearchEngine::SearchFieldsForComparisonMatches(), Resource::Set(), SPTRecommender::SPTRecommender(), and SPTSearchEngine::SPTSearchEngine().

const MetadataSchema::MDFTYPE_FLAG = 32

Definition at line 27 of file MetadataSchema.php.

Referenced by MetadataField::AddDatabaseFields(), Resource::ClearByField(), MetadataField::Drop(), Resource::Get(), MetadataField::GetAllowedConversionTypes(), MetadataField::GetCountOfPossibleValues(), ResourceFactory::GetMatchingResources(), MetadataField::GetPossibleValues(), MetadataField::ModifyField(), Resource::Resource(), SPTSearchEngine::SearchFieldForPhrases(), SPTSearchEngine::SearchFieldsForComparisonMatches(), Resource::Set(), SPTRecommender::SPTRecommender(), and SPTSearchEngine::SPTSearchEngine().

const MetadataSchema::MDFTYPE_IMAGE = 1024

Definition at line 32 of file MetadataSchema.php.

Referenced by MetadataField::AddDatabaseFields(), Resource::ClearByField(), Resource::Delete(), MetadataField::Drop(), Resource::Get(), MetadataField::GetAllowedConversionTypes(), MetadataField::ModifyField(), SPTSearchEngine::SearchFieldForPhrases(), SPTSearchEngine::SearchFieldsForComparisonMatches(), Resource::Set(), SPTRecommender::SPTRecommender(), and SPTSearchEngine::SPTSearchEngine().

const MetadataSchema::MDFTYPE_NUMBER = 4

Definition at line 24 of file MetadataSchema.php.

Referenced by MetadataField::AddDatabaseFields(), Resource::ClearByField(), MetadataField::Drop(), Resource::Get(), MetadataField::GetAllowedConversionTypes(), ResourceFactory::GetMatchingResources(), ResourceFactory::GetResourceIdsSortedBy(), MetadataField::ModifyField(), Resource::Resource(), SPTSearchEngine::SearchFieldForPhrases(), SPTSearchEngine::SearchFieldsForComparisonMatches(), Resource::Set(), SPTRecommender::SPTRecommender(), SPTSearchEngine::SPTSearchEngine(), and UnitTest().

const MetadataSchema::MDFTYPE_OPTION = 256

Definition at line 30 of file MetadataSchema.php.

Referenced by MetadataField::AddDatabaseFields(), Resource::ClearByField(), MetadataField::Drop(), Resource::Get(), MetadataField::GetAllowedConversionTypes(), MetadataField::GetCountOfPossibleValues(), MetadataField::GetFactory(), MetadataField::GetIdForValue(), MetadataField::GetPossibleValues(), Resource::GetQualifierByField(), ResourceFactory::GetResourceCount(), SPTOAIItem::GetSets(), MetadataField::GetValueForId(), SPTOAIItemFactory::LoadSetNameInfo(), MetadataField::ModifyField(), Resource::Resource(), SPTSearchEngine::SearchFieldForPhrases(), SPTSearchEngine::SearchFieldsForComparisonMatches(), Resource::Set(), SPTRecommender::SPTRecommender(), and SPTSearchEngine::SPTSearchEngine().

const MetadataSchema::MDFTYPE_PARAGRAPH = 2

Definition at line 23 of file MetadataSchema.php.

Referenced by MetadataField::AddDatabaseFields(), Resource::ClearByField(), MetadataField::Drop(), Resource::Get(), MetadataField::GetAllowedConversionTypes(), ResourceFactory::GetMatchingResources(), ResourceFactory::GetResourceIdsSortedBy(), MetadataField::ModifyField(), SPTSearchEngine::SearchFieldForPhrases(), SPTSearchEngine::SearchFieldsForComparisonMatches(), Resource::Set(), SPTRecommender::SPTRecommender(), SPTSearchEngine::SPTSearchEngine(), and UnitTest().

const MetadataSchema::MDFTYPE_POINT = 8192

Definition at line 35 of file MetadataSchema.php.

Referenced by MetadataField::AddDatabaseFields(), Resource::ClearByField(), MetadataField::DefaultValue(), MetadataField::Drop(), Resource::Get(), ResourceFactory::GetMatchingResources(), MetadataField::ModifyField(), Resource::Resource(), Resource::Set(), and SPTSearchEngine::SPTSearchEngine().

const MetadataSchema::MDFTYPE_TEXT = 1

Definition at line 22 of file MetadataSchema.php.

Referenced by MetadataField::AddDatabaseFields(), Resource::ClearByField(), MetadataField::Drop(), Resource::Get(), MetadataField::GetAllowedConversionTypes(), ResourceFactory::GetMatchingResources(), ResourceFactory::GetResourceIdsSortedBy(), MetadataField::ModifyField(), SPTSearchEngine::SearchFieldForPhrases(), SPTSearchEngine::SearchFieldsForComparisonMatches(), Resource::Set(), SPTRecommender::SPTRecommender(), and SPTSearchEngine::SPTSearchEngine().

const MetadataSchema::MDFTYPE_TIMESTAMP = 16

Definition at line 26 of file MetadataSchema.php.

Referenced by MetadataField::AddDatabaseFields(), Resource::ClearByField(), MetadataField::Drop(), Resource::Get(), MetadataField::GetAllowedConversionTypes(), ResourceFactory::GetMatchingResources(), ResourceFactory::GetResourceIdsSortedBy(), MetadataField::ModifyField(), Resource::Resource(), SPTSearchEngine::SearchFieldForPhrases(), SPTSearchEngine::SearchFieldsForComparisonMatches(), Resource::Set(), SPTRecommender::SPTRecommender(), and SPTSearchEngine::SPTSearchEngine().

const MetadataSchema::MDFTYPE_TREE = 64

Definition at line 28 of file MetadataSchema.php.

Referenced by MetadataField::AddDatabaseFields(), Resource::ClearByField(), MetadataField::Drop(), Resource::Get(), MetadataField::GetAllowedConversionTypes(), MetadataField::GetCountOfPossibleValues(), MetadataField::GetFactory(), MetadataField::GetIdForValue(), MetadataField::GetPossibleValues(), Resource::GetQualifierByField(), SPTOAIItem::GetSets(), MetadataField::GetValueForId(), SPTOAIItemFactory::LoadSetNameInfo(), MetadataField::ModifyField(), SPTSearchEngine::SearchFieldForPhrases(), SPTSearchEngine::SearchFieldsForComparisonMatches(), Resource::Set(), SPTRecommender::SPTRecommender(), and SPTSearchEngine::SPTSearchEngine().

const MetadataSchema::MDFTYPE_URL = 4096

Definition at line 34 of file MetadataSchema.php.

Referenced by MetadataField::AddDatabaseFields(), Resource::ClearByField(), MetadataField::Drop(), Resource::Get(), MetadataField::GetAllowedConversionTypes(), ResourceFactory::GetMatchingResources(), ResourceFactory::GetResourceIdsSortedBy(), MetadataField::ModifyField(), SPTSearchEngine::SearchFieldForPhrases(), SPTSearchEngine::SearchFieldsForComparisonMatches(), Resource::Set(), SPTRecommender::SPTRecommender(), and SPTSearchEngine::SPTSearchEngine().

const MetadataSchema::MDFTYPE_USER = 512

Definition at line 31 of file MetadataSchema.php.

Referenced by MetadataField::AddDatabaseFields(), Resource::ClearByField(), MetadataField::Drop(), Resource::Get(), MetadataField::GetAllowedConversionTypes(), MetadataField::ModifyField(), SPTSearchEngine::SearchFieldForPhrases(), SPTSearchEngine::SearchFieldsForComparisonMatches(), Resource::Set(), SPTRecommender::SPTRecommender(), and SPTSearchEngine::SPTSearchEngine().

The documentation for this class was generated from the following file:

- MetadataSchema.php