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
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
$_comment
protected
string
$_comment
comment for the attached file
$_date
protected
string
$_date
date when the file was attached
$_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()
$_document
protected
SeedDMS_Core_Document
$_document
reference to document this file belongs to
$_fileType
protected
string
$_fileType
extension of the original file name with a leading '.'
$_id
protected
int
$_id
internal id of document file
$_mimeType
protected
string
$_mimeType
mime type of the file
$_name
protected
string
$_name
name of the file as given by the user
$_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
$_userID
protected
int
$_userID
id of user who is the owner of this link
$_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
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
getComment()
public
getComment() : string
Return values
stringgetDate()
public
getDate() : string
Return values
stringgetDir()
public
getDir() : string
Return values
stringgetDocument()
public
getDocument() : SeedDMS_Core_Document
Return values
SeedDMS_Core_DocumentgetFileType()
public
getFileType() : string
Return values
stringgetID()
public
getID() : int
Return values
intgetMimeType()
public
getMimeType() : string
Return values
stringgetName()
public
getName() : string
Return values
stringgetOriginalFileName()
public
getOriginalFileName() : string
Return values
stringgetPath()
public
getPath() : string
Return values
stringgetUser()
public
getUser() : bool|SeedDMS_Core_User
Return values
bool|SeedDMS_Core_UsergetUserID()
public
getUserID() : int
Return values
intgetVersion()
public
getVersion() : int
Return values
intisPublic()
public
isPublic() : int
Return values
intisType()
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