Open Journal Systems  2.4.4
 All Classes Namespaces Functions Variables Groups Pages
MetadataProperty Class Reference

Public Member Functions

 getAllowedTypes ()
getAssocTypes ()
 getCardinality ()
 getDisplayName ()
 getId ()
 getMandatory ()
 getName ()
 getSupportedCardinalities ()
 getSupportedTypes ()
 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)

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 226 of file

Referenced by isValid().

& 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 218 of file

MetadataProperty::getCardinality ( )

Get the cardinality


Definition at line 242 of file

MetadataProperty::getDisplayName ( )

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


Definition at line 207 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 188 of file

References String\camelize(), and getName().

MetadataProperty::getMandatory ( )

Is this property mandatory?


Definition at line 258 of file

MetadataProperty::getName ( )

Get the name


Definition at line 178 of file

Referenced by getId().

MetadataProperty::getSupportedCardinalities ( )

Return supported cardinalities NB: PHP4 work-around for a public static class member

array supported cardinalities

Definition at line 449 of file

Referenced by MetadataProperty().

MetadataProperty::getSupportedTypes ( )

Return supported meta-data property types

NB: PHP4 work-around for a public static class member

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 432 of file

Referenced by MetadataSchema\getPropertyNamesByType(), isValid(), and MetadataProperty().

MetadataProperty::getTranslated ( )

Is this property translated?


Definition at line 234 of file

MetadataProperty::getValidationMessage ( )

Get the validation message


Definition at line 250 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 280 of file

References getAllowedTypes(), and getSupportedTypes().

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 90 of file

References getSupportedCardinalities(), and getSupportedTypes().

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