Menu

## SeedDMS_Core_DocumentFile
in package

inc.ClassDocument.php : 6117

Class to represent a file attached to a document

Beside the regular document content arbitrary files can be attached to a document. This is a similar concept as attaching files to emails. The owner of the attached file and the document may not be the same. Use SeedDMS_Core_Document::addDocumentFile() to attach a file.

##### 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

$_comment : string
$_date : string
$_dir : string
$_document : SeedDMS_Core_Document
$_fileType : string
$_id : int
$_mimeType : string
$_name : string
$_orgFileName : string
$_public : int
$_user : object
$_userID : int
$_version : int

#### Methods

__construct() : mixed
  SeedDMS_Core_DocumentFile constructor.
content() : mixed
exists() : mixed
getAccessMode() : int
  Returns the access mode similar to a document
getComment() : string
getDate() : string
getDir() : string
getDocument() : SeedDMS_Core_Document
getFileType() : string
getID() : int
getMimeType() : string
getName() : string
getOriginalFileName() : string
getPath() : string
getRealMimeType() : mixed
getUser() : bool|SeedDMS_Core_User
getUserID() : int
getVersion() : int
isPublic() : int
isType() : mixed
  Check if this object is of type 'documentfile'.
setComment() : mixed
setDate() : bool
  Set creation date of the document file
setName() : mixed
setPublic() : mixed
setVersion() : mixed
size() : mixed

### Properties

#### $_comment

inc.ClassDocument.php : 6141
`protected string $_comment`

comment for the attached file

#### $_date

inc.ClassDocument.php : 6146
`protected string $_date`

date when the file was attached

#### $_dir

inc.ClassDocument.php : 6164
`protected string $_dir`

directory where the file is stored. This is the document id with a proceding '/'. FIXME: looks like this isn't used anymore. The file path is constructed by getPath()

#### $_document

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

reference to document this file belongs to

#### $_fileType

inc.ClassDocument.php : 6169
`protected string $_fileType`

extension of the original file name with a leading '.'

#### $_id

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

internal id of document file

#### $_mimeType

inc.ClassDocument.php : 6174
`protected string $_mimeType`

mime type of the file

#### $_name

inc.ClassDocument.php : 6184
`protected string $_name`

name of the file as given by the user

#### $_orgFileName

inc.ClassDocument.php : 6179
`protected string $_orgFileName`

name of the file that was originally uploaded

#### $_public

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

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

#### $_user

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

user who is the owner of this link

#### $_userID

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

id of user who is the owner of this link

#### $_version

inc.ClassDocument.php : 6151
`protected int $_version`

version of document this file is attached to

### Methods

#### __construct()

inc.ClassDocument.php : 6201

SeedDMS_Core_DocumentFile constructor.

`public __construct( $id, $document, $userID, $comment, $date, $dir, $fileType, $mimeType, $orgFileName, $name, $version, $public) : mixed`

##### Parameters

$id :
$document :
$userID :
$comment :
$date :
$dir :
$fileType :
$mimeType :
$orgFileName :
$name :
$version :
$public :

#### content()

inc.ClassDocument.php : 6398
`public content() : mixed`

#### exists()

inc.ClassDocument.php : 6364
`public exists() : mixed`

#### getAccessMode()

inc.ClassDocument.php : 6466

Returns the access mode similar to a document

`public getAccessMode(object $u) : int`

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

##### Parameters

$u : object

  user

##### Return values

int —

either M_NONE or M_READ

#### getComment()

inc.ClassDocument.php : 6244
`public getComment() : string`

##### Return values

string

#### getDate()

inc.ClassDocument.php : 6265
`public getDate() : string`

##### Return values

string

#### getDir()

inc.ClassDocument.php : 6294
`public getDir() : string`

##### Return values

string

#### getDocument()

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

##### Return values

SeedDMS_Core_Document

#### getFileType()

inc.ClassDocument.php : 6299
`public getFileType() : string`

##### Return values

string

#### getID()

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

##### Return values

int

#### getMimeType()

inc.ClassDocument.php : 6304
`public getMimeType() : string`

##### Return values

string

#### getName()

inc.ClassDocument.php : 6324
`public getName() : string`

##### Return values

string

#### getOriginalFileName()

inc.ClassDocument.php : 6319
`public getOriginalFileName() : string`

##### Return values

string

#### getPath()

inc.ClassDocument.php : 6355
`public getPath() : string`

##### Return values

string

#### getRealMimeType()

inc.ClassDocument.php : 6306
`public getRealMimeType() : mixed`

#### getUser()

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

##### Return values

bool|SeedDMS_Core_User

#### getUserID()

inc.ClassDocument.php : 6239
`public getUserID() : int`

##### Return values

int

#### getVersion()

inc.ClassDocument.php : 6413
`public getVersion() : int`

##### Return values

int

#### isPublic()

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

##### Return values

int

#### isType()

inc.ClassDocument.php : 6222

Check if this object is of type 'documentfile'.

`public isType(string $type) : mixed`

##### Parameters

$type : string

  type of object

#### setComment()

inc.ClassDocument.php : 6251
`public setComment(mixed $newComment) : mixed`

##### Parameters

$newComment : mixed

#### setDate()

inc.ClassDocument.php : 6274

Set creation date of the document file

`public setDate([int $date = null ]) : bool`

##### Parameters

$date : int = null

  timestamp of creation date. If false then set it to the current timestamp

##### Return values

bool —

true on success

#### setName()

inc.ClassDocument.php : 6331
`public setName(mixed $newName) : mixed`

##### Parameters

$newName : mixed

#### setPublic()

inc.ClassDocument.php : 6444
`public setPublic(mixed $newPublic) : mixed`

##### Parameters

$newPublic : mixed

#### setVersion()

inc.ClassDocument.php : 6420
`public setVersion(mixed $newVersion) : mixed`

##### Parameters

$newVersion : mixed

#### size()

inc.ClassDocument.php : 6381
`public size() : mixed`

## Search results