Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
MetadataProperty Class Reference

Public Member Functions

 getAllowedTypes ()
getAssocTypes ()
 getCardinality ()
 getDisplayName ()
 getId ()
 getMandatory ()
 getName ()
 getTranslated ()
 getValidationMessage ()
 isValid ($value, $locale=null)
 MetadataProperty ($name, $assocTypes=array(), $allowedTypes=METADATA_PROPERTY_TYPE_STRING, $translated=false, $cardinality=METADATA_PROPERTY_CARDINALITY_ONE, $displayName=null, $validationMessage=null, $mandatory=false)

Static Public Member Functions

static getSupportedCardinalities ()
static getSupportedTypes ()

Public Attributes


Detailed Description

Class representing metadata properties. It specifies type and cardinality of a meta-data property (=term, field, ...) and whether the property can be internationalized. It also provides a validator to test whether input conforms to the property specification.

See Also

In the DCMI abstract model, this class specifies a property together with its allowed range and cardinality.

We also define the resource types (application entities, association types) that can be described with the property. This allows us to check that only valid resource associations are made. It also allows us to prepare property entry forms or displays for a given resource type and integrate these in the work-flow of the resource. By dynamically adding or removing assoc types, end users will be able to configure the meta-data fields that they wish to make available, persist or enter in their application.

Definition at line 53 of file

Member Function Documentation

MetadataProperty::getAllowedTypes ( )

Get the allowed type


Definition at line 250 of file

References $_validationMessage.

& MetadataProperty::getAssocTypes ( )

Get the allowed association types (resources that can be described with this property)

array a list of integers representing association types.

Definition at line 242 of file

References $_cardinality.

MetadataProperty::getCardinality ( )

Get the cardinality


Definition at line 266 of file

MetadataProperty::getDisplayName ( )

Get the translation id representing the display name of the property.


Definition at line 231 of file

MetadataProperty::getId ( )

Returns a canonical form of the property name ready to be used as a property id in an external context (e.g. Forms or Templates).


Definition at line 212 of file

MetadataProperty::getMandatory ( )

Is this property mandatory?


Definition at line 282 of file

MetadataProperty::getName ( )

Get the name


Definition at line 202 of file

static MetadataProperty::getSupportedCardinalities ( )

Return supported cardinalities

array supported cardinalities

Definition at line 470 of file

static MetadataProperty::getSupportedTypes ( )

Return supported meta-data property types

NB: These types are sorted from most specific to most general and will be validated in this order so that we'll always identify more specific types as such (see MetadataProperty::isValid() for more details).

array supported meta-data property types

Definition at line 454 of file

MetadataProperty::getTranslated ( )

Is this property translated?


Definition at line 258 of file

MetadataProperty::getValidationMessage ( )

Get the validation message


Definition at line 274 of file

MetadataProperty::isValid (   $value,
  $locale = null 

Validate a given input against the property specification

The given value must validate against at least one of the allowed types. The first allowed type id will be returned as validation result. If the given value fits none of the allowed types, then we'll return 'false'.

$valuemixed the input to be validated
$localestring the locale to be used for validation
array|boolean an array with a single entry of the format "type => additional type parameter" against which the value validated or boolean false if not validated at all.

Definition at line 304 of file

MetadataProperty::MetadataProperty (   $name,
  $assocTypes = array(),
  $translated = false,
  $displayName = null,
  $validationMessage = null,
  $mandatory = false 


$namestring the unique name of the property within a meta-data schema (can be a property URI)
$assocTypesarray an array of integers that define the application entities that can be described with this property.
$allowedTypesmixed must be a scalar or an array with the supported types, default: METADATA_PROPERTY_TYPE_STRING
$translatedboolean whether the property may have various language versions, default: false
$cardinalityinteger must be on of the supported cardinalities, default: METADATA_PROPERTY_CARDINALITY_ONE
$validationMessagestring A string that can be displayed in case a user tries to set an invalid value for this property.
$mandatoryboolean Is this a mandatory property within the schema?

Definition at line 114 of file

Member Data Documentation

array MetadataProperty::$_allowedTypes

allowed property types

Definition at line 76 of file

int MetadataProperty::$_assocTypes

the resource types that can be described with this property

Definition at line 70 of file

integer MetadataProperty::$_cardinality

property cardinality

Definition at line 88 of file

Referenced by getAssocTypes().

string MetadataProperty::$_displayName

a translation id

Definition at line 64 of file

string MetadataProperty::$_name

property name

Definition at line 58 of file

boolean MetadataProperty::$_translated

flag that defines whether the property can be translated

Definition at line 82 of file

string MetadataProperty::$_validationMessage

validation message

Definition at line 94 of file

Referenced by getAllowedTypes().

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