Documentation

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
category

DMS

author

Uwe Steinmann uwe@steinmann.cx

copyright

Copyright (C) 2010-2024 Uwe Steinmann

version

Release: @package_version@

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

$_attributes

protected array<string|int, mixed> $_attributes

list of attributes

Methods

__construct()

SeedDMS_Core_Object constructor.

public __construct( $id) : mixed
Parameters
$id :

getAttributes()

Returns all attributes set for the object

public getAttributes() : array<string|int, mixed>|bool
Return values
array<string|int, mixed>|bool

getAttributeValue()

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

getID()

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

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


        
On this page

Search results