Menu

## SeedDMS_Core_Object
in package

inc.ClassObject.php : 27

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() : mixed
  Returns an attribute value of the object for the given attribute definition This is a short cut for $object->getAttribute($attrdef)->getValue()
getAttributeValueAsArray() : mixed
  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

inc.ClassObject.php : 41
`public SeedDMS_Core_DMS $_dms`

back reference to document management system

#### $_attributes

inc.ClassObject.php : 36
`protected array<string|int, mixed> $_attributes`

list of attributes

#### $_id

inc.ClassObject.php : 31
`protected int $_id`

unique id of object

### Methods

#### __construct()

inc.ClassObject.php : 47

SeedDMS_Core_Object constructor.

`public __construct( $id) : mixed`

##### Parameters

$id :

#### getAttribute()

inc.ClassObject.php : 136

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()

inc.ClassObject.php : 96

Returns all attributes set for the object

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

##### Return values

array<string|int, mixed>|bool

#### getAttributeValue()

inc.ClassObject.php : 156

Returns an attribute value of the object for the given attribute definition This is a short cut for $object->getAttribute($attrdef)->getValue()

`public getAttributeValue(SeedDMS_Core_AttributeDefinition $attrdef) : mixed`

##### Parameters

$attrdef : SeedDMS_Core_AttributeDefinition

##### Return values

mixed —

value of attritbute or null if the attribute is not set. The value is an array if the attribute is defined as multi value

#### getAttributeValueAsArray()

inc.ClassObject.php : 179

Returns an attribute value of the object for the given attribute definition

`public getAttributeValueAsArray(SeedDMS_Core_AttributeDefinition $attrdef) : mixed`

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

mixed —

value of attritbute or null if the attribute is not set. Even if the attribute is not defined as multi value

#### getAttributeValueAsString()

inc.ClassObject.php : 202

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()

inc.ClassObject.php : 80

Returns instance of dms

`public getDMS() : SeedDMS_Core_DMS`

##### Return values

SeedDMS_Core_DMS

#### getID()

inc.ClassObject.php : 89

Returns the internal id of the object

`public getID() : int`

##### Return values

int —

id of document/folder

#### isType()

inc.ClassObject.php : 59

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()

inc.ClassObject.php : 296

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()

inc.ClassObject.php : 222

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()

inc.ClassObject.php : 71

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

## Search results