Documentation

SeedDMS_Core_DocumentFile
in package

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
$_userID  : int
$_version  : int

Methods

__construct()  : mixed
SeedDMS_Core_DocumentFile constructor.
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
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

Properties

$_dir

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

$_fileType

protected string $_fileType

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

$_orgFileName

protected string $_orgFileName

name of the file that was originally uploaded

$_public

protected int $_public

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

$_version

protected int $_version

version of document this file is attached to

Methods

__construct()

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 :

getAccessMode()

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

getOriginalFileName()

public getOriginalFileName() : string
Return values
string

isType()

Check if this object is of type 'documentfile'.

public isType(string $type) : mixed
Parameters
$type : string

type of object

setComment()

public setComment(mixed $newComment) : mixed
Parameters
$newComment : mixed

setDate()

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

public setName(mixed $newName) : mixed
Parameters
$newName : mixed

setPublic()

public setPublic(mixed $newPublic) : mixed
Parameters
$newPublic : mixed

setVersion()

public setVersion(mixed $newVersion) : mixed
Parameters
$newVersion : mixed

        
On this page

Search results