SeedDMS_Core_Object
in package
Class to represent a generic object in the document management system
This is the base class for generic objects in SeedDMS.
Tags
Table of Contents
Properties
- $_dms : SeedDMS_Core_DMS
- $_attributes : array<string|int, mixed>
- $_id : int
Methods
- __construct() : mixed
- SeedDMS_Core_Object constructor.
- getAttribute() : array<string|int, mixed>|string
- Returns an attribute of the object for the given attribute definition
- getAttributes() : array<string|int, mixed>|bool
- Returns all attributes set for the object
- getAttributeValue() : array<string|int, mixed>|string
- Returns an attribute value of the object for the given attribute definition
- getAttributeValueAsArray() : array<string|int, mixed>|bool
- Returns an attribute value of the object for the given attribute definition
- getAttributeValueAsString() : string
- Returns an attribute value of the object for the given attribute definition
- getDMS() : SeedDMS_Core_DMS
- Returns instance of dms
- getID() : int
- Returns the internal id of the object
- isType() : mixed
- Check if this object is of a given type.
- removeAttribute() : bool
- Remove an attribute of the object for the given attribute definition
- setAttributeValue() : bool
- Set an attribute of the object for the given attribute definition
- setDMS() : mixed
- Set dms this object belongs to.
Properties
$_dms
public
SeedDMS_Core_DMS
$_dms
back reference to document management system
$_attributes
protected
array<string|int, mixed>
$_attributes
list of attributes
$_id
protected
int
$_id
unique id of object
Methods
__construct()
SeedDMS_Core_Object constructor.
public
__construct( $id) : mixed
Parameters
getAttribute()
Returns an attribute of the object for the given attribute definition
public
getAttribute(SeedDMS_Core_AttributeDefinition $attrdef) : array<string|int, mixed>|string
Parameters
- $attrdef : SeedDMS_Core_AttributeDefinition
Return values
array<string|int, mixed>|string —value of attritbute or false. The value is an array if the attribute is defined as multi value
getAttributes()
Returns all attributes set for the object
public
getAttributes() : array<string|int, mixed>|bool
Return values
array<string|int, mixed>|boolgetAttributeValue()
Returns an attribute value of the object for the given attribute definition
public
getAttributeValue(SeedDMS_Core_AttributeDefinition $attrdef) : array<string|int, mixed>|string
Parameters
- $attrdef : SeedDMS_Core_AttributeDefinition
Return values
array<string|int, mixed>|string —value of attritbute or false. The value is an array if the attribute is defined as multi value
getAttributeValueAsArray()
Returns an attribute value of the object for the given attribute definition
public
getAttributeValueAsArray(SeedDMS_Core_AttributeDefinition $attrdef) : array<string|int, mixed>|bool
This is a short cut for getAttribute($attrdef)->getValueAsArray() but first checks if the object has an attribute for the given attribute definition.
Parameters
- $attrdef : SeedDMS_Core_AttributeDefinition
Return values
array<string|int, mixed>|bool —even if the attribute is not defined as multi value
getAttributeValueAsString()
Returns an attribute value of the object for the given attribute definition
public
getAttributeValueAsString(SeedDMS_Core_AttributeDefinition $attrdef) : string
This is a short cut for getAttribute($attrdef)->getValueAsString() but first checks if the object has an attribute for the given attribute definition.
Parameters
- $attrdef : SeedDMS_Core_AttributeDefinition
Return values
string —value of attritbute or false. The value is always a string even if the attribute is defined as multi value
getDMS()
Returns instance of dms
public
getDMS() : SeedDMS_Core_DMS
Return values
SeedDMS_Core_DMSgetID()
Returns the internal id of the object
public
getID() : int
Return values
int —id of document/folder
isType()
Check if this object is of a given type.
public
isType(string $type) : mixed
This method must be implemened in the child class
Parameters
- $type : string
-
type of object
removeAttribute()
Remove an attribute of the object for the given attribute definition
public
removeAttribute(SeedDMS_Core_AttributeDefinition $attrdef) : bool
FIXME: shouldn't this rather be setAttributeValue() with an empty value?
Parameters
- $attrdef : SeedDMS_Core_AttributeDefinition
Return values
bool —true if operation was successful, otherwise false
setAttributeValue()
Set an attribute of the object for the given attribute definition
public
setAttributeValue(SeedDMS_Core_AttributeDefinition $attrdef, array<string|int, mixed>|string $value) : bool
Parameters
- $attrdef : SeedDMS_Core_AttributeDefinition
-
definition of attribute
- $value : array<string|int, mixed>|string
-
value of attribute, for multiple values this must be an array
Return values
bool —true if operation was successful, otherwise false
setDMS()
Set dms this object belongs to.
public
setDMS(SeedDMS_Core_DMS $dms) : mixed
Each object needs a reference to the dms it belongs to. It will be set when the object is created. The dms has a references to the currently logged in user and the database connection.
Parameters
- $dms : SeedDMS_Core_DMS
-
reference to dms