Menu

## SeedDMS_Core_DMS
in package

inc.ClassDMS.php : 75

Class to represent the complete document management system.

This class is needed to do most of the dms operations. It needs an instance of SeedDMS_Core_DatabaseAccess to access the underlying database. Many methods are factory functions which create objects representing the entities in the dms, like folders, documents, users, or groups.

Each dms has its own database for meta data and a data store for document content. Both must be specified when creating a new instance of this class. All folders and documents are organized in a hierachy like a regular file system starting with a SeedDMS_Core_DMS::rootFolderID

This class does not enforce any access rights on documents and folders by design. It is up to the calling application to use the methods SeedDMS_Core_Folder::getAccessMode() and SeedDMS_Core_Document::getAccessMode() and interpret them as desired. Though, there are two convenient functions to filter a list of documents/folders for which users have access rights for. See SeedDMS_Core_DMS::filterAccess() and SeedDMS_Core_DMS::filterUsersByAccess()

Though, this class has a method to set the currently logged in user (SeedDMS_Core_DMS::setUser()), it does not have to be called, because there is currently no class within the SeedDMS core which needs the logged in user. SeedDMS_Core_DMS itself does not do any user authentication. It is up to the application using this class.

    <?php
    include("inc/inc.ClassDMS.php");
    $db = new SeedDMS_Core_DatabaseAccess($type, $hostname, $user, $passwd, $name);
    $db->connect() or die ("Could not connect to db-server");
    $dms = new SeedDMS_Core_DMS($db, $contentDir);
    $dms->setRootFolderID(1);
    ...
    ?>

##### Tags

category

  DMS

author

  Uwe Steinmann uwe@steinmann.cx

copyright

  Copyright (C) 2010-2024 Uwe Steinmann

### Table of Contents

#### Properties

$callbacks : array<string|int, mixed>
$checkWithinRootDir : bool
$contentDir : string
$forceLink : bool
$forceRename : bool
$lasterror : string
$maxDirID : int
$memcache : object
$noReadForStatus : array<string|int, mixed>
$rootFolderID : int
$usecache : bool
$version : string
$cache : array<string|int, mixed>
$classnames : array<string|int, mixed>
$db : SeedDMS_Core_DatabaseAccess
$decorators : array<string|int, mixed>
$storage : SeedDMS_Core_Storage
$user : SeedDMS_Core_User

#### Methods

__construct() : mixed
  Create a new instance of the dms
addAttributeDefinition() : bool|SeedDMS_Core_User
  Add a new attribute definition
addCallback() : bool
  Add a callback function
addDecorator() : bool
  Add a decorator
addDocumentCategory() : SeedDMS_Core_DocumentCategory|bool
  Add a new document category
addGroup() : SeedDMS_Core_Group|bool
  Create a new user group
addKeywordCategory() : mixed
addUser() : bool|SeedDMS_Core_User
  Add a new user
addWorkflow() : bool|SeedDMS_Core_Workflow
  Add a new workflow
addWorkflowAction() : SeedDMS_Core_Workflow_Action|bool
  Add new workflow action
addWorkflowState() : bool|SeedDMS_Core_Workflow_State
  Add new workflow state
checkDate() : bool
  Checks if date conforms to a given format
checkDocuments() : array<string|int, mixed>|bool
  Returns a list of documents and error message not linked in the tree
checkFolders() : array<string|int, mixed>|bool
  Returns a list of folders and error message not linked in the tree
checkIfEqual() : bool
  Checks if two objects are equal by comparing their IDs
checkPasswordRequest() : bool|SeedDMS_Core_User
  Check if hash for a password request is valid.
checkVersion() : bool
  Check if the version in the database is the same as of this package Only the major and minor version number will be checked.
countTasks() : array<string|int, mixed>
  Returns number of documents with a given task
createPasswordRequest() : string|bool
  Create a token to request a new password.
deletePasswordRequest() : bool
  Delete a password request
filterAccess() : array<string|int, mixed>
  Filter out objects which are not accessible in a given mode by a user.
filterDocumentFiles() : array<string|int, mixed>
  Filter out document attachments which can not be accessed by a given user
filterDocumentLinks() : array<string|int, mixed>
  Filter out document links which can not be accessed by a given user
filterUsersByAccess() : array<string|int, mixed>
  Filter out users which cannot access an object in a given mode.
getAllAttributeDefinitions() : bool|array<string|int, SeedDMS_Core_AttributeDefinition>
  Return list of all attribute definitions
getAllGroups() : array<string|int, SeedDMS_Core_Group>
  Get a list of all groups
getAllKeywordCategories() : mixed
getAllUserKeywordCategories() : array<string|int, SeedDMS_Core_KeywordCategory>|bool
  This method should be replaced by getAllKeywordCategories()
getAllUsers() : array<string|int, mixed>
  Return list of all users
getAllWorkflowActions() : array<string|int, SeedDMS_Core_Workflow_Action>|bool
  Return list of workflow action
getAllWorkflows() : array<string|int, SeedDMS_Core_Workflow>|bool
  Return list of all workflows
getAllWorkflowStates() : array<string|int, SeedDMS_Core_Workflow_State>|bool
  Return list of all workflow states
getAttributeDefinition() : bool|SeedDMS_Core_AttributeDefinition
  Return a attribute definition by its id
getAttributeDefinitionByName() : SeedDMS_Core_AttributeDefinition|bool
  Return a attribute definition by its name
getClassname() : string
  Return class name of classes instanciated by SeedDMS_Core
getDB() : SeedDMS_Core_DatabaseAccess
  Return database where meta data is stored
getDBVersion() : array<string|int, mixed>|bool
  Return the database version
getDecorators() : array<string|int, mixed>
  Return list of decorators
getDocument() : SeedDMS_Core_Document
  Return a document by its id
getDocumentByName() : SeedDMS_Core_Document|null|bool
  Returns a document by its name
getDocumentByOriginalFilename() : SeedDMS_Core_Document|null|bool
  Returns a document by the original file name of the last version
getDocumentCategories() : mixed
getDocumentCategory() : mixed
getDocumentCategoryByName() : SeedDMS_Core_DocumentCategory|bool
  Get a category by its name
getDocumentContent() : bool|null|SeedDMS_Core_DocumentContent
  Return a document content by its id
getDocumentList() : array<string|int, mixed>|bool
  Returns all documents with a predefined search criteria
getDocumentsByUser() : array<string|int, mixed>
  Returns all documents of a given user
getDocumentsExpired() : bool|array<string|int, SeedDMS_Core_Document>
  Returns all documents which already expired or will expire in the future
getDocumentsLockedByUser() : array<string|int, mixed>
  Returns all documents locked by a given user
getDuplicateDocumentContent() : array<string|int, mixed>|bool
  Returns document content which is duplicated
getDuplicateSequenceNo() : array<string|int, mixed>|bool
  Returns folders which contain documents with none unique sequence number
getFolder() : SeedDMS_Core_Folder
  Return a folder by its id
getFolderByName() : SeedDMS_Core_Folder|bool
  Return a folder by its name
getGroup() : SeedDMS_Core_Group|bool
  Get a group by its id
getGroupByName() : SeedDMS_Core_Group|bool
  Get a group by its name
getKeywordCategory() : mixed
getKeywordCategoryByName() : mixed
getLinksToItself() : array<string|int, mixed>|bool
  Returns documents which have link to themselves
getLoggedInUser() : SeedDMS_Core_User
  Get the logged in user
getMimeTypes() : mixed
getNoChecksumDocumentContent() : bool|array<string|int, SeedDMS_Core_Document>
  Returns document content which has no checksum set
getNoFileSizeDocumentContent() : array<string|int, SeedDMS_Core_Document>|bool
  Returns document content which has no file size set
getNotificationsByGroup() : array<string|int, mixed>
  Get all notifications for a group
getNotificationsByUser() : array<string|int, mixed>
  Get all notifications for a user
getProcessWithoutUserGroup() : array<string|int, mixed>
  Returns a list of reviews, approvals, receipts, revisions which are not linked to a user, group anymore
getRootFolder() : SeedDMS_Core_Folder|bool
  Get root folder
getStatisticalData() : array<string|int, mixed>|bool
  Returns statitical information
getStorage() : SeedDMS_Core_Storage
  Return storage where files are stored
getUnlinkedDocumentContent() : array<string|int, mixed>|bool
  Returns document content which is not linked to a document
getUser() : SeedDMS_Core_User|bool
  Return a user by its id
getUserByEmail() : object
  Return a user by its email
getUserByLogin() : object
  Return a user by its login
getWorkflow() : SeedDMS_Core_Workflow|bool
  Return workflow by its Id
getWorkflowAction() : SeedDMS_Core_Workflow_Action|bool
  Return a workflow action by its id
getWorkflowActionByName() : SeedDMS_Core_Workflow_Action|bool
  Return a workflow action by its name
getWorkflowByName() : SeedDMS_Core_Workflow|bool
  Return workflow by its name
getWorkflowState() : bool|SeedDMS_Core_Workflow_State
  Return a workflow state by its id
getWorkflowStateByName() : bool|SeedDMS_Core_Workflow_State
  Return workflow state by its name
getWorkflowTransition() : SeedDMS_Core_Workflow_Transition|bool
  Return a workflow transition by its id
hasCallback() : bool
  Check if a callback with the given name has been set
inList() : bool|int
  Checks if a list of objects contains a single object by comparing their IDs
makeTimeStamp() : int|bool
  Create a unix time stamp
removeProcessWithoutUserGroup() : array<string|int, mixed>
  Removes all reviews, approvals which are not linked to a user, group anymore
search() : mixed
setCallback() : bool
  Set a callback function
setClassname() : string
  Set class name of instantiated objects
setForceLink() : mixed
setForceRename() : mixed
setMaxDirID() : mixed
  Set maximum number of subdirectories per directory
setMemcache() : void
  Set memcache server
setRootFolderID() : bool
  Set id of root folder
setUser() : bool|object
  Set the logged in user
getSqlForAttribute() : mixed

### Properties

#### $callbacks

inc.ClassDMS.php : 211
`public array<string|int, mixed> $callbacks`

list of methods called when certain operations, like removing a document, are executed. Set a callback with SeedDMS_Core_DMS::setCallback(). The key of the array is the internal callback function name. Each array element is an array with two elements: the function name and the parameter passed to the function.

Currently implemented callbacks are:

onPreRemoveDocument($user_param, $document); called before deleting a document. If this function returns false the document will not be deleted.

onPostRemoveDocument($user_param, $document_id); called after the successful deletion of a document.

##### Tags

access

  public

#### $checkWithinRootDir

inc.ClassDMS.php : 172
`public bool $checkWithinRootDir`

check if folder/document being accessed is within the rootdir

##### Tags

access

  public

#### $contentDir

inc.ClassDMS.php : 123
`public string $contentDir`

location in the file system where all the document data is located. This should be an absolute path.

##### Tags

access

  public

#### $forceLink

inc.ClassDMS.php : 158
`public bool $forceLink`

use linkFile() instead of copyFile() when copying the document content into the data store. The default is to copy the file. This parameter only affects the method SeedDMS_Core_Document::addDocument(). Use this with care, because it will leave the original document at its place.

##### Tags

access

  public

#### $forceRename

inc.ClassDMS.php : 148
`public bool $forceRename`

use renameFile() instead of copyFile() when copying the document content into the data store. The default is to copy the file. This parameter only affects the methods SeedDMS_Core_Document::addDocument() and SeedDMS_Core_Document::addDocumentFile(). Setting this to true may save resources especially for large files.

##### Tags

access

  public

#### $lasterror

inc.ClassDMS.php : 223
`public string $lasterror`

last error message. This can be set by hooks to pass an error message from the hook to the application which has called the method containing the hook. For example SeedDMS_Core_Document::remove() calls the hook 'onPreRemoveDocument'. The hook function can set $dms->lasterror which can than be read when SeedDMS_Core_Document::remove() fails. This variable could be set in any SeedDMS_Core class, but is currently only set by hooks.

##### Tags

access

  public

#### $maxDirID

inc.ClassDMS.php : 137
`public int $maxDirID`

maximum number of documents per folder on the filesystem. If this variable is set to a value != 0, the content directory will have a two level hierarchy for document storage.

##### Tags

access

  public

#### $memcache

inc.ClassDMS.php : 94
`public object $memcache`

reference to memcache.

##### Tags

access

  protected

#### $noReadForStatus

inc.ClassDMS.php : 165
`public array<string|int, mixed> $noReadForStatus`

list of status without read right online.

##### Tags

access

  public

#### $rootFolderID

inc.ClassDMS.php : 129
`public int $rootFolderID`

ID of root folder

##### Tags

access

  public

#### $usecache

inc.ClassDMS.php : 184
`public bool $usecache`

true if internal cache shall be used

##### Tags

access

  public

#### $version

inc.ClassDMS.php : 178
`public string $version`

version of pear package

##### Tags

access

  public

#### $cache

inc.ClassDMS.php : 190
`protected array<string|int, mixed> $cache`

cache for various objects

##### Tags

access

  public

#### $classnames

inc.ClassDMS.php : 101
`protected array<string|int, mixed> $classnames`

list of classnames for objects being instanciate by the dms

##### Tags

access

  protected

#### $db

inc.ClassDMS.php : 81
`protected SeedDMS_Core_DatabaseAccess $db`

reference to database object. This must be an instance of SeedDMS_Core_DatabaseAccess.

##### Tags

access

  protected

#### $decorators

inc.ClassDMS.php : 108
`protected array<string|int, mixed> $decorators`

list of decorators for objects being instanciate by the dms

##### Tags

access

  protected

#### $storage

inc.ClassDMS.php : 88
`protected SeedDMS_Core_Storage $storage`

reference to storage object. This must be an instance SeedDMS_Core_Storage_File.

##### Tags

access

  protected

#### $user

inc.ClassDMS.php : 116
`private SeedDMS_Core_User $user`

reference to currently logged in user. This must be an instance of SeedDMS_Core_User. This variable is currently not used. It is set by SeedDMS_Core_DMS::setUser().

##### Tags

access

  private

### Methods

#### __construct()

inc.ClassDMS.php : 403

Create a new instance of the dms

`public __construct(SeedDMS_Core_DatabaseAccess $db, string $contentDir) : mixed`

##### Parameters

$db : SeedDMS_Core_DatabaseAccess

  object of class SeedDMS_Core_DatabaseAccess to access the underlying database

$contentDir : string

  path in filesystem containing the data store all document contents is stored

#### addAttributeDefinition()

inc.ClassDMS.php : 2919

Add a new attribute definition

`public addAttributeDefinition(string $name, $objtype, string $type[, bool|int $multiple = 0 ][, int $minvalues = 0 ][, int $maxvalues = 1 ][, string $valueset = '' ][, string $regex = '' ]) : bool|SeedDMS_Core_User`

##### Parameters

$name : string

  name of attribute

$objtype :
$type : string

  type of attribute

$multiple : bool|int = 0

  set to 1 if attribute has multiple attributes

$minvalues : int = 0

  minimum number of values

$maxvalues : int = 1

  maximum number of values if multiple is set

$valueset : string = ''

  list of allowed values (csv format)

$regex : string = ''

##### Return values

bool|SeedDMS_Core_User

#### addCallback()

inc.ClassDMS.php : 3815

Add a callback function

`public addCallback(string $name, mixed $func[, mixed $params = null ]) : bool`

The function passed in $func must be a callable and $name must not be empty. This method does not check if there is a callback with the given name.

##### Parameters

$name : string

  internal name of callback

$func : mixed

  function name as expected by {call_user_method}

$params : mixed = null

  parameter passed as the first argument to the callback

##### Return values

bool —

true if adding the callback succeeds otherwise false

#### addDecorator()

inc.ClassDMS.php : 516

Add a decorator

`public addDecorator(string $objectname, mixed $decorator) : bool`

This method adds a single decorator class name to the list of decorators of those objects being instantiated by the dms. Each class has an internal place holder, which must be passed to function.

##### Parameters

$objectname : string

  placeholder (can be one of 'folder', 'document', 'documentcontent', 'user', 'group')

$decorator : mixed

##### Return values

bool —

true if decorator could be added, otherwise false

#### addDocumentCategory()

inc.ClassDMS.php : 2691

Add a new document category

`public addDocumentCategory(string $name) : SeedDMS_Core_DocumentCategory|bool`

This method calls the hook `onPostAddDocumentCategory` if the new category was added successfully.

##### Parameters

$name : string

  name of category

##### Return values

SeedDMS_Core_DocumentCategory|bool —

instance of SeedDMS_Core_DocumentCategory or false if the category already exists or in case of an error.

#### addGroup()

inc.ClassDMS.php : 2505

Create a new user group

`public addGroup(string $name, string $comment) : SeedDMS_Core_Group|bool`

##### Parameters

$name : string

  name of group

$comment : string

  comment of group

##### Return values

SeedDMS_Core_Group|bool —

instance of SeedDMS_Core_Group or false in case of an error.

#### addKeywordCategory()

inc.ClassDMS.php : 2597
`public addKeywordCategory(mixed $userID, mixed $name) : mixed`

##### Parameters

$userID : mixed
$name : mixed

#### addUser()

inc.ClassDMS.php : 2425

Add a new user

`public addUser(string $login, string $pwd, string $fullName, string $email, string $language, string $theme, string $comment[, int|string $role = '0' ][, int $isHidden = 0 ][, int $isDisabled = 0 ][, string $pwdexpiration = '' ][, int $quota = 0 ][, null $homefolder = null ]) : bool|SeedDMS_Core_User`

This method calls the hook `onPostAddUser` after the user has been added successfully.

##### Parameters

$login : string

  login name

$pwd : string

  hashed password of new user

$fullName : string

  full name of user

$email : string

  Email of new user

$language : string

  language of new user

$theme : string

  theme

$comment : string

  comment of new user

$role : int|string = '0'

  role of new user (can be 0=normal, 1=admin, 2=guest)

$isHidden : int = 0

  hide user in all lists, if this is set login is still allowed

$isDisabled : int = 0

  disable user and prevent login

$pwdexpiration : string = ''
$quota : int = 0
$homefolder : null = null

##### Return values

bool|SeedDMS_Core_User —

or false if the user already exists or in case of an error

#### addWorkflow()

inc.ClassDMS.php : 3039

Add a new workflow

`public addWorkflow(string $name, SeedDMS_Core_Workflow_State $initstate) : bool|SeedDMS_Core_Workflow`

##### Parameters

$name : string

  name of workflow

$initstate : SeedDMS_Core_Workflow_State

  initial state of workflow

##### Return values

bool|SeedDMS_Core_Workflow

#### addWorkflowAction()

inc.ClassDMS.php : 3240

Add new workflow action

`public addWorkflowAction(string $name) : SeedDMS_Core_Workflow_Action|bool`

##### Parameters

$name : string

  name of workflow action

##### Return values

SeedDMS_Core_Workflow_Action|bool

#### addWorkflowState()

inc.ClassDMS.php : 3139

Add new workflow state

`public addWorkflowState(string $name, int $docstatus) : bool|SeedDMS_Core_Workflow_State`

##### Parameters

$name : string

  name of workflow state

$docstatus : int

  document status when this state is reached

##### Return values

bool|SeedDMS_Core_Workflow_State

#### checkDate()

inc.ClassDMS.php : 283

Checks if date conforms to a given format

`public static checkDate(string $date[, string $format = 'Y-m-d H:i:s' ]) : bool`

##### Parameters

$date : string

  date to be checked

$format : string = 'Y-m-d H:i:s'

  format of date. Will default to 'Y-m-d H:i:s' if format is not given.

##### Return values

bool —

true if date is in propper format, otherwise false

#### checkDocuments()

inc.ClassDMS.php : 2291

Returns a list of documents and error message not linked in the tree

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

This method checks all documents in the database.

##### Return values

array<string|int, mixed>|bool

#### checkFolders()

inc.ClassDMS.php : 2237

Returns a list of folders and error message not linked in the tree

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

This method checks all folders in the database.

##### Return values

array<string|int, mixed>|bool

#### checkIfEqual()

inc.ClassDMS.php : 243

Checks if two objects are equal by comparing their IDs

`public static checkIfEqual(object $object1, object $object2) : bool`

The regular php check done by '==' compares all attributes of two objects, which is often not required. This method will first check if the objects are instances of the same class and than if they have the same id.

##### Parameters

$object1 : object

  first object to be compared

$object2 : object

  second object to be compared

##### Return values

bool —

true if objects are equal, otherwise false

#### checkPasswordRequest()

inc.ClassDMS.php : 2776

Check if hash for a password request is valid.

`public checkPasswordRequest(string $hash) : bool|SeedDMS_Core_User`

This method searches a previously created password request and returns the user.

##### Parameters

$hash : string

##### Return values

bool|SeedDMS_Core_User

#### checkVersion()

inc.ClassDMS.php : 572

Check if the version in the database is the same as of this package Only the major and minor version number will be checked.

`public checkVersion() : bool`

##### Return values

bool —

returns false if versions do not match, but returns true if version matches or table tblVersion does not exists.

#### countTasks()

inc.ClassDMS.php : 981

Returns number of documents with a given task

`public countTasks(string $listtype[, object $user = null ][, mixed $param5 = true ]) : array<string|int, mixed>`

##### Parameters

$listtype : string

  type of document list, can be 'AppRevByMe', 'AppRevOwner', 'WorkflowByMe'

$user : object = null

  user

$param5 : mixed = true

##### Return values

array<string|int, mixed> —

number of tasks

#### createPasswordRequest()

inc.ClassDMS.php : 2751

Create a token to request a new password.

`public createPasswordRequest(SeedDMS_Core_User $user) : string|bool`

This method will not delete the password but just creates an entry in `tblUserRequestPassword` indicating a password request.

##### Parameters

$user : SeedDMS_Core_User

##### Return values

string|bool —

hash value of false in case of an error

#### deletePasswordRequest()

inc.ClassDMS.php : 2797

Delete a password request

`public deletePasswordRequest(string $hash) : bool`

##### Parameters

$hash : string

##### Return values

bool

#### filterAccess()

inc.ClassDMS.php : 302

Filter out objects which are not accessible in a given mode by a user.

`public static filterAccess(array<string|int, mixed> $objArr, object $user, int $minMode) : array<string|int, mixed>`

The list of objects to be checked can be of any class, but has to have a method getAccessMode($user) which checks if the given user has at least the access right on the object as passed in $minMode. Hence, passing a group instead of a user is possible.

##### Parameters

$objArr : array<string|int, mixed>

  list of objects (either documents or folders)

$user : object

  user for which access is checked

$minMode : int

  minimum access mode required (M_ANY, M_NONE, M_READ, M_READWRITE, M_ALL)

##### Return values

array<string|int, mixed> —

filtered list of objects

#### filterDocumentFiles()

inc.ClassDMS.php : 384

Filter out document attachments which can not be accessed by a given user

`public static filterDocumentFiles(object $user, array<string|int, mixed> $files) : array<string|int, mixed>`

Returns a filtered list of files which are accessible by the given user. A file is only accessible, if it is publically visible, owned by the user, or the accessing user is an administrator.

##### Parameters

$user : object

  user for which access is being checked

$files : array<string|int, mixed>

  list of objects of type SeedDMS_Core_DocumentFile

##### Return values

array<string|int, mixed> —

filtered list of files

#### filterDocumentLinks()

inc.ClassDMS.php : 353

Filter out document links which can not be accessed by a given user

`public static filterDocumentLinks(object $user, array<string|int, SeedDMS_Core_DocumentLink> $links[, string $access = '' ]) : array<string|int, mixed>`

Returns a filtered list of links which are accessible by the given user. A link is only accessible, if it is publically visible, owned by the user, or the accessing user is an administrator.

##### Parameters

$user : object

  user for which access is being checked

$links : array<string|int, SeedDMS_Core_DocumentLink>

  list of objects of type SeedDMS_Core_DocumentLink

$access : string = ''

  set if source or target of link shall be checked for sufficient access rights. Set to 'source' if the source document of a link is to be checked, set to 'target' for the target document. If not set, then access rights will not be checked at all.

##### Return values

array<string|int, mixed> —

filtered list of links

#### filterUsersByAccess()

inc.ClassDMS.php : 329

Filter out users which cannot access an object in a given mode.

`public static filterUsersByAccess(object $obj, array<string|int, mixed> $users, int $minMode) : array<string|int, mixed>`

The list of users to be checked can be of any class, but has to have a method getAccessMode($user) which checks if a user has at least the access right as passed in $minMode. Hence, passing a list of groups instead of users is possible.

##### Parameters

$obj : object

  object that shall be accessed

$users : array<string|int, mixed>

  list of users/groups which are to check for sufficient access rights

$minMode : int

  minimum access right on the object for each user (M_ANY, M_NONE, M_READ, M_READWRITE, M_ALL)

##### Return values

array<string|int, mixed> —

filtered list of users

#### getAllAttributeDefinitions()

inc.ClassDMS.php : 2868

Return list of all attribute definitions

`public getAllAttributeDefinitions([int|array<string|int, mixed> $objtype = 0 ][, int|array<string|int, mixed> $type = 0 ]) : bool|array<string|int, SeedDMS_Core_AttributeDefinition>`

##### Parameters

$objtype : int|array<string|int, mixed> = 0

  select those attribute definitions defined for an object type

$type : int|array<string|int, mixed> = 0

  select those attribute definitions defined for a type

##### Return values

bool|array<string|int, SeedDMS_Core_AttributeDefinition> —

of instances of SeedDMS_Core_AttributeDefinition or false or false

#### getAllGroups()

inc.ClassDMS.php : 2492

Get a list of all groups

`public getAllGroups() : array<string|int, SeedDMS_Core_Group>`

##### Return values

array<string|int, SeedDMS_Core_Group> —

array of instances of SeedDMS_Core_Group

#### getAllKeywordCategories()

inc.ClassDMS.php : 2563
`public getAllKeywordCategories([mixed $userIDs = array() ]) : mixed`

##### Parameters

$userIDs : mixed = array()

#### getAllUserKeywordCategories()

inc.ClassDMS.php : 2591

This method should be replaced by getAllKeywordCategories()

`public getAllUserKeywordCategories( $userID) : array<string|int, SeedDMS_Core_KeywordCategory>|bool`

##### Parameters

$userID :

##### Return values

array<string|int, SeedDMS_Core_KeywordCategory>|bool

#### getAllUsers()

inc.ClassDMS.php : 2398

Return list of all users

`public getAllUsers([string $orderby = '' ]) : array<string|int, mixed>`

##### Parameters

$orderby : string = ''

##### Return values

array<string|int, mixed> —

list of instances of SeedDMS_Core_User or false in case of an error

#### getAllWorkflowActions()

inc.ClassDMS.php : 3216

Return list of workflow action

`public getAllWorkflowActions() : array<string|int, SeedDMS_Core_Workflow_Action>|bool`

##### Return values

array<string|int, SeedDMS_Core_Workflow_Action>|bool —

list of instances of SeedDMS_Core_Workflow_Action or false

#### getAllWorkflows()

inc.ClassDMS.php : 2949

Return list of all workflows

`public getAllWorkflows() : array<string|int, SeedDMS_Core_Workflow>|bool`

##### Return values

array<string|int, SeedDMS_Core_Workflow>|bool —

of instances of SeedDMS_Core_Workflow or false

#### getAllWorkflowStates()

inc.ClassDMS.php : 3115

Return list of all workflow states

`public getAllWorkflowStates() : array<string|int, SeedDMS_Core_Workflow_State>|bool`

##### Return values

array<string|int, SeedDMS_Core_Workflow_State>|bool —

of instances of SeedDMS_Core_Workflow_State or false

#### getAttributeDefinition()

inc.ClassDMS.php : 2814

Return a attribute definition by its id

`public getAttributeDefinition(int $id) : bool|SeedDMS_Core_AttributeDefinition`

This method retrieves a attribute definitionr from the database by its id.

##### Parameters

$id : int

  internal id of attribute defintion

##### Return values

bool|SeedDMS_Core_AttributeDefinition —

or false

#### getAttributeDefinitionByName()

inc.ClassDMS.php : 2841

Return a attribute definition by its name

`public getAttributeDefinitionByName(string $name) : SeedDMS_Core_AttributeDefinition|bool`

This method retrieves an attribute def. from the database by its name.

##### Parameters

$name : string

  internal name of attribute def.

##### Return values

SeedDMS_Core_AttributeDefinition|bool —

instance of SeedDMS_Core_AttributeDefinition or false

#### getClassname()

inc.ClassDMS.php : 453

Return class name of classes instanciated by SeedDMS_Core

`public getClassname(string $objectname) : string`

This method returns the class name of those objects being instantiated by the dms. Each class has an internal place holder, which must be passed to function.

##### Parameters

$objectname : string

  placeholder (can be one of 'folder', 'document', 'documentcontent', 'user', 'group')

##### Return values

string —

name of class or false if object name is invalid

#### getDB()

inc.ClassDMS.php : 529

Return database where meta data is stored

`public getDB() : SeedDMS_Core_DatabaseAccess`

This method returns the database object as it was set by the first parameter of the constructor.

##### Return values

SeedDMS_Core_DatabaseAccess —

database

#### getDBVersion()

inc.ClassDMS.php : 550

Return the database version

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

##### Return values

array<string|int, mixed>|bool

#### getDecorators()

inc.ClassDMS.php : 496

Return list of decorators

`public getDecorators(string $objectname) : array<string|int, mixed>`

This method returns the list of decorator class names of those objects being instantiated by the dms. Each class has an internal place holder, which must be passed to function.

##### Parameters

$objectname : string

  placeholder (can be one of 'folder', 'document', 'documentcontent', 'user', 'group')

##### Return values

array<string|int, mixed> —

list of class names or false if object name is invalid

#### getDocument()

inc.ClassDMS.php : 717

Return a document by its id

`public getDocument(int $id) : SeedDMS_Core_Document`

This method retrieves a document from the database by its id.

##### Parameters

$id : int

  internal id of document

##### Return values

SeedDMS_Core_Document —

instance of SeedDMS_Core_Document, null or false

#### getDocumentByName()

inc.ClassDMS.php : 875

Returns a document by its name

`public getDocumentByName(string $name[, object $folder = null ]) : SeedDMS_Core_Document|null|bool`

This method searches a document by its name and restricts the search to the given folder if passed as the second parameter. If there are more than one document with that name, then only the one with the highest id will be returned.

##### Parameters

$name : string

  Name of the document

$folder : object = null

  parent folder of document

##### Return values

SeedDMS_Core_Document|null|bool —

found document or null if not document was found or false in case of an error

#### getDocumentByOriginalFilename()

inc.ClassDMS.php : 916

Returns a document by the original file name of the last version

`public getDocumentByOriginalFilename(string $name[, object $folder = null ]) : SeedDMS_Core_Document|null|bool`

This method searches a document by the name of the last document version and restricts the search to given folder if passed as the second parameter. If there are more than one document with that name, then only the one with the highest id will be returned.

##### Parameters

$name : string

  Name of the original file

$folder : object = null

  parent folder of document

##### Return values

SeedDMS_Core_Document|null|bool —

found document or null if not document was found or false in case of an error

#### getDocumentCategories()

inc.ClassDMS.php : 2641
`public getDocumentCategories() : mixed`

#### getDocumentCategory()

inc.ClassDMS.php : 2624
`public getDocumentCategory(mixed $id) : mixed`

##### Parameters

$id : mixed

#### getDocumentCategoryByName()

inc.ClassDMS.php : 2666

Get a category by its name

`public getDocumentCategoryByName(string $name) : SeedDMS_Core_DocumentCategory|bool`

The name of a category is by default unique.

##### Parameters

$name : string

  human readable name of category

##### Return values

SeedDMS_Core_DocumentCategory|bool —

instance of SeedDMS_Core_DocumentCategory

#### getDocumentContent()

inc.ClassDMS.php : 956

Return a document content by its id

`public getDocumentContent(int $id) : bool|null|SeedDMS_Core_DocumentContent`

This method retrieves a document content from the database by its id.

##### Parameters

$id : int

  internal id of document content

##### Return values

bool|null|SeedDMS_Core_DocumentContent —

found document content or null if not document content was found or false in case of an error

#### getDocumentList()

inc.ClassDMS.php : 1118

Returns all documents with a predefined search criteria

`public getDocumentList(string $listtype[, SeedDMS_Core_User $param1 = null ][, bool|int|string $param2 = false ][, string $param3 = '' ][, string $param4 = '' ][, bool $param5 = true ]) : array<string|int, mixed>|bool`

The records return have the following elements

From Table tblDocuments [id] => id of document [name] => name of document [comment] => comment of document [date] => timestamp of creation date of document [expires] => timestamp of expiration date of document [owner] => user id of owner [folder] => id of parent folder [folderList] => column separated list of folder ids, e.g. :1:41: [inheritAccess] => 1 if access is inherited [defaultAccess] => default access mode [locked] => always -1 (TODO: is this field still used?) [keywords] => keywords of document [sequence] => sequence of document

From Table tblDocumentLocks [lockUser] => id of user locking the document

From Table tblDocumentStatusLog [version] => latest version of document [statusID] => id of latest status log [documentID] => id of document [status] => current status of document [statusComment] => comment of current status [statusDate] => datetime when the status was entered, e.g. 2014-04-17 21:35:51 [userID] => id of user who has initiated the status change

From Table tblUsers [ownerName] => name of owner of document [statusName] => name of user who has initiated the status change

##### Parameters

$listtype : string

  type of document list, can be 'AppRevByMe', 'AppRevOwner', 'ReceiptByMe', 'ReviseByMe', 'LockedByMe', 'MyDocs'

$param1 : SeedDMS_Core_User = null

  user

$param2 : bool|int|string = false

  if set to true 'ReviewByMe', 'ApproveByMe', 'AppRevByMe', 'ReviseByMe', 'ReceiptByMe' will also return documents which the reviewer, approver, etc. has already taken care of. If set to false only untouched documents will be returned. In case of 'ExpiredOwner' this parameter contains the number of days (a negative number is allowed) relativ to the current date or a date in format 'yyyy-mm-dd' (even in the past).

$param3 : string = ''

  sort list by this field

$param4 : string = ''

  order direction

$param5 : bool = true

  set to false if expired documents shall not be considered

##### Return values

array<string|int, mixed>|bool

#### getDocumentsByUser()

inc.ClassDMS.php : 728

Returns all documents of a given user

`public getDocumentsByUser(object $user) : array<string|int, mixed>`

##### Parameters

$user : object

##### Return values

array<string|int, mixed> —

list of documents

#### getDocumentsExpired()

inc.ClassDMS.php : 765

Returns all documents which already expired or will expire in the future

`public getDocumentsExpired(string $date[, SeedDMS_Core_User $user = null ][, string $orderby = 'e' ][, string $orderdir = 'desc' ][, bool $update = true ]) : bool|array<string|int, SeedDMS_Core_Document>`

The parameter $date will be relative to the start of the day. It can be either a number of days (if an integer is passed) or a date string in the format 'YYYY-MM-DD'. If the parameter $date is a negative number or a date in the past, then all documents from the start of that date till the end of the current day will be returned. If $date is a positive integer or $date is a date in the future, then all documents from the start of the current day till the end of the day of the given date will be returned. Passing 0 or the current date in $date, will return all documents expiring the current day.

##### Parameters

$date : string

  date in format YYYY-MM-DD or an integer with the number of days. A negative value will cover the days in the past.

$user : SeedDMS_Core_User = null

  limits the documents on those owned by this user

$orderby : string = 'e'

  n=name, e=expired

$orderdir : string = 'desc'

  d=desc or a=asc

$update : bool = true

  update status of document if set to true

##### Return values

bool|array<string|int, SeedDMS_Core_Document>

#### getDocumentsLockedByUser()

inc.ClassDMS.php : 738

Returns all documents locked by a given user

`public getDocumentsLockedByUser(object $user) : array<string|int, mixed>`

##### Parameters

$user : object

##### Return values

array<string|int, mixed> —

list of documents

#### getDuplicateDocumentContent()

inc.ClassDMS.php : 3379

Returns document content which is duplicated

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

This method is for finding document content which is available twice in the database. The checksum of a document content was introduced in version 4.0.0 of SeedDMS for finding duplicates.

##### Return values

array<string|int, mixed>|bool

#### getDuplicateSequenceNo()

inc.ClassDMS.php : 3424

Returns folders which contain documents with none unique sequence number

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

This method is for finding folders with documents not having a unique sequence number. Those documents cannot propperly be sorted by sequence and changing their position is impossible if more than two documents with the same sequence number exists, e.g. doc 1: 3 doc 2: 5 doc 3: 5 doc 4: 5 doc 5: 7 If document 4 was to be moved between doc 1 and 2 it get sequence number 4 ((5+3)/2). But if document 4 was to be moved between doc 2 and 3 it will again have sequence number 5.

##### Return values

array<string|int, mixed>|bool

#### getFolder()

inc.ClassDMS.php : 2201

Return a folder by its id

`public getFolder(int $id) : SeedDMS_Core_Folder`

This method retrieves a folder from the database by its id.

##### Parameters

$id : int

  internal id of folder

##### Return values

SeedDMS_Core_Folder —

instance of SeedDMS_Core_Folder or false

#### getFolderByName()

inc.ClassDMS.php : 2224

Return a folder by its name

`public getFolderByName(string $name[, SeedDMS_Core_Folder $folder = null ]) : SeedDMS_Core_Folder|bool`

This method retrieves a folder from the database by its name. The search covers the whole database. If the parameter $folder is not null, it will search for the name only within this parent folder. It will not be done recursively.

##### Parameters

$name : string

  name of the folder

$folder : SeedDMS_Core_Folder = null

  parent folder

##### Return values

SeedDMS_Core_Folder|bool —

found folder or false

#### getGroup()

inc.ClassDMS.php : 2464

Get a group by its id

`public getGroup(int $id) : SeedDMS_Core_Group|bool`

##### Parameters

$id : int

  id of group

##### Return values

SeedDMS_Core_Group|bool —

group or false if no group was found

#### getGroupByName()

inc.ClassDMS.php : 2481

Get a group by its name

`public getGroupByName(string $name) : SeedDMS_Core_Group|bool`

##### Parameters

$name : string

  name of group

##### Return values

SeedDMS_Core_Group|bool —

group or false if no group was found

#### getKeywordCategory()

inc.ClassDMS.php : 2529
`public getKeywordCategory(mixed $id) : mixed`

##### Parameters

$id : mixed

#### getKeywordCategoryByName()

inc.ClassDMS.php : 2546
`public getKeywordCategoryByName(mixed $name, mixed $userID) : mixed`

##### Parameters

$name : mixed
$userID : mixed

#### getLinksToItself()

inc.ClassDMS.php : 3445

Returns documents which have link to themselves

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

##### Return values

array<string|int, mixed>|bool

#### getLoggedInUser()

inc.ClassDMS.php : 705

Get the logged in user

`public getLoggedInUser() : SeedDMS_Core_User`

Returns the currently logged in user, previously set by SeedDMS_Core_DMS::setUser()

##### Return values

SeedDMS_Core_User —

$user

#### getMimeTypes()

inc.ClassDMS.php : 3768
`public getMimeTypes() : mixed`

#### getNoChecksumDocumentContent()

inc.ClassDMS.php : 3349

Returns document content which has no checksum set

`public getNoChecksumDocumentContent() : bool|array<string|int, SeedDMS_Core_Document>`

This method is for finding document content without a checksum set in the database. The checksum of a document content was introduced in version 4.0.0 of SeedDMS for finding duplicates.

##### Return values

bool|array<string|int, SeedDMS_Core_Document>

#### getNoFileSizeDocumentContent()

inc.ClassDMS.php : 3319

Returns document content which has no file size set

`public getNoFileSizeDocumentContent() : array<string|int, SeedDMS_Core_Document>|bool`

This method is for finding document content without a file size set in the database. The file size of a document content was introduced in version 4.0.0 of SeedDMS for implementation of user quotas.

##### Return values

array<string|int, SeedDMS_Core_Document>|bool

#### getNotificationsByGroup()

inc.ClassDMS.php : 2725

Get all notifications for a group

`public getNotificationsByGroup(object $group[, int $type = 0 ]) : array<string|int, mixed>`

deprecated: User SeedDMS_Core_Group::getNotifications()

##### Parameters

$group : object

  group for which notifications are to be retrieved

$type : int = 0

  type of item (T_DOCUMENT or T_FOLDER)

##### Return values

array<string|int, mixed> —

array of notifications

#### getNotificationsByUser()

inc.ClassDMS.php : 2738

Get all notifications for a user

`public getNotificationsByUser(object $user[, int $type = 0 ]) : array<string|int, mixed>`

deprecated: User SeedDMS_Core_User::getNotifications()

##### Parameters

$user : object

  user for which notifications are to be retrieved

$type : int = 0

  type of item (T_DOCUMENT or T_FOLDER)

##### Return values

array<string|int, mixed> —

array of notifications

#### getProcessWithoutUserGroup()

inc.ClassDMS.php : 3472

Returns a list of reviews, approvals, receipts, revisions which are not linked to a user, group anymore

`public getProcessWithoutUserGroup(string $process, string $usergroup) : array<string|int, mixed>`

This method is for finding reviews or approvals whose user or group was deleted and not just removed from the process.

##### Parameters

$process : string
$usergroup : string

##### Return values

array<string|int, mixed>

#### getRootFolder()

inc.ClassDMS.php : 659

Get root folder

`public getRootFolder() : SeedDMS_Core_Folder|bool`

##### Return values

SeedDMS_Core_Folder|bool —

return the object of the root folder or false if the root folder id was not set before with SeedDMS_Core_DMS::setRootFolderID().

#### getStatisticalData()

inc.ClassDMS.php : 3548

Returns statitical information

`public getStatisticalData([string $type = '' ]) : array<string|int, mixed>|bool`

This method returns all kind of statistical information like documents or used space per user, recent activity, etc.

##### Parameters

$type : string = ''

  type of statistic

##### Return values

array<string|int, mixed>|bool —

returns false if the sql statement fails, returns an empty array if no documents or folder where found, otherwise returns a non empty array with statistical data

#### getStorage()

inc.ClassDMS.php : 541

Return storage where files are stored

`public getStorage() : SeedDMS_Core_Storage`

This method returns the storage object as it was set by the second parameter of the constructor.

##### Return values

SeedDMS_Core_Storage

#### getUnlinkedDocumentContent()

inc.ClassDMS.php : 3292

Returns document content which is not linked to a document

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

This method is for finding straying document content without a parent document. In normal operation this should not happen but little checks for database consistency and possible errors in the application may have left over document content though the document is gone already.

##### Return values

array<string|int, mixed>|bool

#### getUser()

inc.ClassDMS.php : 2351

Return a user by its id

`public getUser(int $id) : SeedDMS_Core_User|bool`

This method retrieves a user from the database by its id.

##### Parameters

$id : int

  internal id of user

##### Return values

SeedDMS_Core_User|bool —

instance of SeedDMS_Core_User or false

#### getUserByEmail()

inc.ClassDMS.php : 2387

Return a user by its email

`public getUserByEmail(int $email) : object`

This method retrieves a user from the database by its email. It is needed when the user requests a new password.

##### Parameters

$email : int

  email address of user

##### Return values

object —

instance of SeedDMS_Core_User or false in case of an error

#### getUserByLogin()

inc.ClassDMS.php : 2373

Return a user by its login

`public getUserByLogin(string $login[, string $email = '' ]) : object`

This method retrieves a user from the database by its login. If the second optional parameter $email is not empty, the user must also have the given email.

##### Parameters

$login : string

  internal login of user

$email : string = ''

  email of user

##### Return values

object —

instance of SeedDMS_Core_User or false

#### getWorkflow()

inc.ClassDMS.php : 2984

Return workflow by its Id

`public getWorkflow(int $id) : SeedDMS_Core_Workflow|bool`

##### Parameters

$id : int

  internal id of workflow

##### Return values

SeedDMS_Core_Workflow|bool —

of instances of SeedDMS_Core_Workflow, null if no workflow was found or false

#### getWorkflowAction()

inc.ClassDMS.php : 3163

Return a workflow action by its id

`public getWorkflowAction(int $id) : SeedDMS_Core_Workflow_Action|bool`

This method retrieves a workflow action from the database by its id.

##### Parameters

$id : int

  internal id of workflow action

##### Return values

SeedDMS_Core_Workflow_Action|bool —

instance of SeedDMS_Core_Workflow_Action or false

#### getWorkflowActionByName()

inc.ClassDMS.php : 3191

Return a workflow action by its name

`public getWorkflowActionByName(string $name) : SeedDMS_Core_Workflow_Action|bool`

This method retrieves a workflow action from the database by its name.

##### Parameters

$name : string

  name of workflow action

##### Return values

SeedDMS_Core_Workflow_Action|bool —

instance of SeedDMS_Core_Workflow_Action or false

#### getWorkflowByName()

inc.ClassDMS.php : 3011

Return workflow by its name

`public getWorkflowByName(string $name) : SeedDMS_Core_Workflow|bool`

##### Parameters

$name : string

  name of workflow

##### Return values

SeedDMS_Core_Workflow|bool —

of instances of SeedDMS_Core_Workflow or null if no workflow was found or false

#### getWorkflowState()

inc.ClassDMS.php : 3063

Return a workflow state by its id

`public getWorkflowState(int $id) : bool|SeedDMS_Core_Workflow_State`

This method retrieves a workflow state from the database by its id.

##### Parameters

$id : int

  internal id of workflow state

##### Return values

bool|SeedDMS_Core_Workflow_State —

or false

#### getWorkflowStateByName()

inc.ClassDMS.php : 3089

Return workflow state by its name

`public getWorkflowStateByName(string $name) : bool|SeedDMS_Core_Workflow_State`

##### Parameters

$name : string

  name of workflow state

##### Return values

bool|SeedDMS_Core_Workflow_State —

or false

#### getWorkflowTransition()

inc.ClassDMS.php : 3264

Return a workflow transition by its id

`public getWorkflowTransition(int $id) : SeedDMS_Core_Workflow_Transition|bool`

This method retrieves a workflow transition from the database by its id.

##### Parameters

$id : int

  internal id of workflow transition

##### Return values

SeedDMS_Core_Workflow_Transition|bool —

instance of SeedDMS_Core_Workflow_Transition or false

#### hasCallback()

inc.ClassDMS.php : 3830

Check if a callback with the given name has been set

`public hasCallback(string $name) : bool`

##### Parameters

$name : string

  internal name of callback

##### Return values

bool —

true if callback exists otherwise false

#### inList()

inc.ClassDMS.php : 267

Checks if a list of objects contains a single object by comparing their IDs

`public static inList(object $object, array<string|int, mixed> $list) : bool|int`

This method is only applicable on list containing objects which have a method getID() because it is used to check if two objects are equal. The regular php check on objects done by '==' compares all attributes of two objects, which often isn't required. The method will first check if the objects are instances of the same class.

The result of the function can be 0 which happens if the first element of an indexed array matches.

##### Parameters

$object : object

  object to look for (needle)

$list : array<string|int, mixed>

  list of objects (haystack)

##### Return values

bool|int —

index in array if object was found, otherwise false

#### makeTimeStamp()

inc.ClassDMS.php : 1502

Create a unix time stamp

`public makeTimeStamp(int $hour, int $min, int $sec, int $year, int $month, int $day) : int|bool`

This method is much like `mktime()` but does some range checks on the passed values.

##### Parameters

$hour : int

  hour

$min : int

  minute

$sec : int

  second

$year : int

  year

$month : int

  month

$day : int

  day

##### Return values

int|bool —

unix time stamp or false if range check failed

#### removeProcessWithoutUserGroup()

inc.ClassDMS.php : 3506

Removes all reviews, approvals which are not linked to a user, group anymore

`public removeProcessWithoutUserGroup(string $process, string $usergroup[, int $id = 0 ]) : array<string|int, mixed>`

This method is for removing all reviews or approvals whose user or group was deleted and not just removed from the process. If the optional parameter $id is set, only this user/group id is removed.

##### Parameters

$process : string
$usergroup : string
$id : int = 0

##### Return values

array<string|int, mixed>

#### search()

inc.ClassDMS.php : 1675
`public search(mixed $query[, mixed $limit = 0 ][, mixed $offset = 0 ][, mixed $logicalmode = 'AND' ][, mixed $searchin = array() ][, mixed $startFolder = null ][, mixed $owner = null ][, mixed $status = array() ][, mixed $creationstartdate = array() ][, mixed $creationenddate = array() ][, mixed $modificationstartdate = array() ][, mixed $modificationenddate = array() ][, mixed $categories = array() ][, mixed $attributes = array() ][, mixed $mode = 0x3 ][, mixed $expirationstartdate = array() ][, mixed $expirationenddate = array() ]) : mixed`

##### Parameters

$query : mixed
$limit : mixed = 0
$offset : mixed = 0
$logicalmode : mixed = 'AND'
$searchin : mixed = array()
$startFolder : mixed = null
$owner : mixed = null
$status : mixed = array()
$creationstartdate : mixed = array()
$creationenddate : mixed = array()
$modificationstartdate : mixed = array()
$modificationenddate : mixed = array()
$categories : mixed = array()
$attributes : mixed = array()
$mode : mixed = 0x3
$expirationstartdate : mixed = array()
$expirationenddate : mixed = array()

#### setCallback()

inc.ClassDMS.php : 3794

Set a callback function

`public setCallback(string $name, mixed $func[, mixed $params = null ]) : bool`

The function passed in $func must be a callable and $name must not be empty.

Setting a callback with this method will remove all previously set callbacks. Use SeedDMS_Core_DMS::addCallback() to register additional callbacks. This method does not check if there is a callback with the given name.

##### Parameters

$name : string

  internal name of callback

$func : mixed

  function name as expected by {call_user_method}

$params : mixed = null

  parameter passed as the first argument to the callback

##### Return values

bool —

true if adding the callback succeeds otherwise false

#### setClassname()

inc.ClassDMS.php : 474

Set class name of instantiated objects

`public setClassname(string $objectname, string $classname) : string`

This method sets the class name of those objects being instatiated by the dms. It is mainly used to create a new class (possible inherited from one of the available classes) implementing new features. The method should be called in the postInitDMS hook.

##### Parameters

$objectname : string

  placeholder (can be one of 'folder', 'document', 'documentcontent', 'user', 'group'

$classname : string

  name of class

##### Return values

string —

name of old class or false if not set

#### setForceLink()

inc.ClassDMS.php : 668
`public setForceLink(mixed $enable) : mixed`

##### Parameters

$enable : mixed

#### setForceRename()

inc.ClassDMS.php : 664
`public setForceRename(mixed $enable) : mixed`

##### Parameters

$enable : mixed

#### setMaxDirID()

inc.ClassDMS.php : 649

Set maximum number of subdirectories per directory

`public setMaxDirID(int $id) : mixed`

The value of maxDirID is quite crucial, because each document is stored within a directory in the filesystem. Consequently, there can be a maximum number of documents, because depending on the file system the maximum number of subdirectories is limited. Since version 3.3.0 of SeedDMS an additional directory level has been introduced, which will be created when maxDirID is not 0. All documents from 1 to maxDirID-1 will be saved in 1/, documents from maxDirID to 2*maxDirID-1 are stored in 2/ and so on.

Modern file systems like ext4 do not have any restrictions on the number of subdirectories anymore. Therefore it is best if this parameter is set to 0. Never change this parameter if documents has already been created.

This method must be called right after creating an instance of SeedDMS_Core_DMS

##### Parameters

$id : int

  id of root folder

#### setMemcache()

inc.ClassDMS.php : 602

Set memcache server

`public setMemcache(object $memcache) : void`

This method must be called right after creating an instance of SeedDMS_Core_DMS

If the memcache server is set, SeedDMS_Core_DMS will make use of it if possible.

##### Parameters

$memcache : object

  memcache object created with new Memcached()

#### setRootFolderID()

inc.ClassDMS.php : 618

Set id of root folder

`public setRootFolderID(int $id) : bool`

This method must be called right after creating an instance of SeedDMS_Core_DMS

The new root folder id will only be set if the folder actually exists. In that case the old root folder id will be returned. If it does not exists, the method will return false;

##### Parameters

$id : int

  id of root folder

##### Return values

bool —

old root folder id if new root folder exists, otherwise false

#### setUser()

inc.ClassDMS.php : 683

Set the logged in user

`public setUser(object $user) : bool|object`

This method tells SeeDMS_Core_DMS the currently logged in user. It must be called right after instanciating the class, because some methods in SeedDMS_Core_Document() require the currently logged in user.

##### Parameters

$user : object

  this muss not be empty and an instance of SeedDMS_Core_User

##### Return values

bool|object —

returns the old user object or null on success, otherwise false

#### getSqlForAttribute()

inc.ClassDMS.php : 1531
`protected getSqlForAttribute(mixed $attrdef, mixed $attribute, mixed $table, mixed $field) : mixed`

##### Parameters

$attrdef : mixed
$attribute : mixed
$table : mixed
$field : mixed

## Search results