Menu

## SeedDMS_Core_DocumentLink
in package

inc.ClassDocument.php : 5979

Class to represent a link between two document

Document links are to establish a reference from one document to another document. The owner of the document link may not be the same as the owner of one of the documents. Use SeedDMS_Core_Document::addDocumentLink() to add a reference to another document.

##### Tags

category

  DMS

author

  Markus Westphal, Malcolm Cowe, Matteo Lucarelli, Uwe Steinmann uwe@steinmann.cx

copyright

  Copyright (C) 2002-2005 Markus Westphal, 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli, 2010-2024 Uwe Steinmann

version

  Release: @package_version@

### Table of Contents

#### Properties

$_document : SeedDMS_Core_Document
$_id : int
$_public : int
$_target : object
$_user : object
$_userID : int

#### Methods

__construct() : mixed
  SeedDMS_Core_DocumentLink constructor.
getAccessMode() : int
  Returns the access mode similar to a document
getDocument() : SeedDMS_Core_Document
getID() : int
getTarget() : object
getUser() : bool|SeedDMS_Core_User
isPublic() : int
isType() : mixed
  Check if this object is of type 'documentlink'.

### Properties

#### $_document

inc.ClassDocument.php : 5988
`protected SeedDMS_Core_Document $_document`

reference to document this link belongs to

#### $_id

inc.ClassDocument.php : 5983
`protected int $_id`

internal id of document link

#### $_public

inc.ClassDocument.php : 6008
`protected int $_public`

1 if this link is public, or 0 if is only visible to the owner

#### $_target

inc.ClassDocument.php : 5993
`protected object $_target`

reference to target document this link points to

#### $_user

inc.ClassDocument.php : 6003
`protected object $_user`

user who is the owner of this link

#### $_userID

inc.ClassDocument.php : 5998
`protected int $_userID`

id of user who is the owner of this link

### Methods

#### __construct()

inc.ClassDocument.php : 6018

SeedDMS_Core_DocumentLink constructor.

`public __construct( $id, $document, $target, $userID, $public) : mixed`

##### Parameters

$id :
$document :
$target :
$userID :
$public :

#### getAccessMode()

inc.ClassDocument.php : 6083

Returns the access mode similar to a document

`public getAccessMode(SeedDMS_Core_User $u, $source, $target) : int`

There is no real access mode for document links, so this is just another way to add more access restrictions than the default restrictions. It is only called for public document links, not accessed by the owner or the administrator.

##### Parameters

$u : SeedDMS_Core_User

  user

$source :
$target :

##### Return values

int —

either M_NONE or M_READ

#### getDocument()

inc.ClassDocument.php : 6044
`public getDocument() : SeedDMS_Core_Document`

##### Return values

SeedDMS_Core_Document

#### getID()

inc.ClassDocument.php : 6039
`public getID() : int`

##### Return values

int

#### getTarget()

inc.ClassDocument.php : 6051
`public getTarget() : object`

##### Return values

object

#### getUser()

inc.ClassDocument.php : 6058
`public getUser() : bool|SeedDMS_Core_User`

##### Return values

bool|SeedDMS_Core_User

#### isPublic()

inc.ClassDocument.php : 6068
`public isPublic() : int`

##### Return values

int

#### isType()

inc.ClassDocument.php : 6032

Check if this object is of type 'documentlink'.

`public isType(string $type) : mixed`

##### Parameters

$type : string

  type of object

## Search results