\SeedDMS_Core_AttributeDefinition

Class to represent an attribute definition in the document management system

Attribute definitions specify the name, type, object type, minimum and maximum values and a value set. The object type determines the object an attribute may be attached to. If the object type is set to object_all the attribute can be used for documents, document content and folders.

The type of an attribute specifies the skalar data type.

Attributes for which multiple values are allowed must have the multiple flag set to true and specify a value set. A value set is a string consisting of n separated values. The separator is the first char of the value set. A possible value could be '|REV-A|REV-B' If multiple values are allowed, then minvalues and maxvalues may restrict the allowed number of values.

Summary

Methods
Properties
Constants
SeedDMS_Core_AttributeDefinition()
setDMS()
getID()
getName()
setName()
getObjType()
setObjType()
getType()
setType()
getMultipleValues()
setMultipleValues()
getMinValues()
setMinValues()
getMaxValues()
setMaxValues()
getValueSet()
getValueSetAsArray()
getValueSetValue()
setValueSet()
getRegex()
setRegex()
isUsed()
getStatistics()
remove()
No public properties found
type_int
type_float
type_string
type_boolean
objtype_all
objtype_folder
objtype_document
objtype_documentcontent
No protected methods found
$_id
$_name
$_type
$_objtype
$_multiple
$_minvalues
$_maxvalues
$_valueset
$_regex
$_dms
N/A
No private methods found
No private properties found
N/A

Constants

type_int

type_int

type_float

type_float

type_string

type_string

type_boolean

type_boolean

objtype_all

objtype_all

objtype_folder

objtype_folder

objtype_document

objtype_document

objtype_documentcontent

objtype_documentcontent

Properties

$_id

$_id : integer

Type

integer — id of attribute definition

$_name

$_name : string

Type

string — name of attribute definition

$_type

$_type : string

Type

string — object type of attribute definition. This can be one of type_int, type_float, type_string, or type_boolean.

$_objtype

$_objtype : string

Type

string — type of attribute definition. This can be one of objtype_all, objtype_folder, objtype_document, or objtype_documentcontent.

$_multiple

$_multiple : boolean

Type

boolean — whether an attribute can have multiple values

$_minvalues

$_minvalues : integer

Type

integer — minimum values of an attribute

$_maxvalues

$_maxvalues : integer

Type

integer — maximum values of an attribute

$_valueset

$_valueset : string

Type

string — list of possible values of an attribute

$_regex

$_regex : string

Type

string — regular expression the value must match

$_dms

$_dms : object

Type

object — SeedDMS_Core_DMS reference to the dms instance this attribute definition belongs to

Methods

SeedDMS_Core_AttributeDefinition()

SeedDMS_Core_AttributeDefinition(integer $id, string $name, integer $objtype, integer $type, boolean $multiple, integer $minvalues, integer $maxvalues, string $valueset,  $regex)

Constructor

Parameters

integer $id

internal id of attribute definition

string $name

name of attribute

integer $objtype

type of object for which this attribute definition

   may be used.
integer $type

skalar type of attribute

boolean $multiple

set to true if multiple values are allowed

integer $minvalues

minimum number of values

integer $maxvalues

maximum number of values

string $valueset

separated list of allowed values, the first char

   is taken as the separator
$regex

setDMS()

setDMS(\SeedDMS_Core_DMS $dms)

Set reference to dms

Parameters

\SeedDMS_Core_DMS $dms

getID()

getID()

getName()

getName()

setName()

setName( $name)

Parameters

$name

getObjType()

getObjType()

setObjType()

setObjType( $objtype)

Parameters

$objtype

getType()

getType()

setType()

setType( $type)

Parameters

$type

getMultipleValues()

getMultipleValues()

setMultipleValues()

setMultipleValues( $mv)

Parameters

$mv

getMinValues()

getMinValues()

setMinValues()

setMinValues( $minvalues)

Parameters

$minvalues

getMaxValues()

getMaxValues()

setMaxValues()

setMaxValues( $maxvalues)

Parameters

$maxvalues

getValueSet()

getValueSet() : string

Get the value set as saved in the database

Returns

string —

value set

getValueSetAsArray()

getValueSetAsArray() : array

Get the whole value set as an array

Returns

array —

values of value set or false if the value set has

    less than 2 chars

getValueSetValue()

getValueSetValue( $ind) : string

Get the n'th value of a value set

Parameters

$ind

Returns

string —

n'th value of value set or false if the index is

    out of range or the value set has less than 2 chars

setValueSet()

setValueSet(string $valueset) : boolean

Set the value set

A value set is a list of values allowed for an attribute. The values are separated by a char which must also be the first char of the value set string.

Parameters

string $valueset

Returns

boolean —

true if value set could be set, otherwise false

getRegex()

getRegex() : string

Get the regular expression as saved in the database

Returns

string —

regular expression

setRegex()

setRegex(string $regex) : boolean

Set the regular expression

A value of the attribute must match this regular expression.

Parameters

string $regex

Returns

boolean —

true if regex could be set, otherwise false

isUsed()

isUsed() : boolean

Check if the attribute definition is used

Checks all documents, folders and document content whether at least one of them referenceѕ this attribute definition

Returns

boolean —

true if attribute definition is used, otherwise false

getStatistics()

getStatistics(integer $limit) : boolean

Return a list of documents, folders, document contents where this attribute definition is used

Parameters

integer $limit

return not more the n objects of each type

Returns

boolean —

true if attribute definition is used, otherwise false

remove()

remove() : boolean

Remove the attribute definition Removal is only executed when the definition is not used anymore.

Returns

boolean —

true on success or false in case of an error