PHP 클래스 Attachment

저자: Marcel Werk
상속: extends DatabaseObject
파일 보기 프로젝트 열기: sourcefabric/newscoop 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$m_columnNames
$m_dbTableName
$m_keyColumnNames
$m_keyIsAutoIncrement

공개 메소드들

메소드 설명
Attachment ( $p_id = null )
GetTotalAttachments ( ) : integer
GetUnedited ( $p_id ) : array Return the ids of the file not edited yet.
OnFileUpload ( array $p_fileVar, array $p_attributes, integer $p_id = null, boolean $p_uploaded = false ) : mixed This function should be called when an attachment is uploaded. It will save the attachment to the appropriate place on the disk, and create a database entry for the file.
ProcessFile ( string $p_tmpFile, string $p_newFile, integer $p_userId = NULL, $p_attributes = NULL ) : Image | null Process multi-upload file.
delete ( ) constructor
getAttachmentId ( ) : integer
getAttachmentUri ( ) : string Return the full URL to the attached image.
getAttachmentUrl ( ) : string Return the full URL to the attached image.
getCharset ( ) : string Return the CHARSET which should be set in the HTTP header sent to the downloader.
getContentDisposition ( ) : mixed Return whether the "content-disposition" HTTP header should be set.
getDescription ( integer $p_languageId ) : string Get the description in the given language.
getDescriptionId ( ) : integer Get the description ID which is an index into the Translations table.
getExtension ( ) : string Return the file name extension
getFileName ( ) : string
getLanguageId ( ) : integer If this attachment is language-specific, e.g. a PDF written in Serbian, this will return the language id of the attachment.
getLastModified ( ) fn setDescription
getLevel1DirectoryName ( ) fn getStorageLocation
getLevel2DirectoryName ( ) fn getLevel1DirectoryName
getMimeType ( ) : string Return the MIME type which should be set in the HTTP header to the downloader.
getSizeInBytes ( ) : integer Get the size of the file in bytes
getSource ( ) : string
getStatus ( ) : string
getStorageLocation ( ) : string Get the full path to the storage location of the file on disk.
getTimeCreated ( ) fn getLastModified
getUploadingUserId ( ) : integer
inUse ( ) : boolean Return true if the attachment is being used by an article.
makeDirectories ( ) fn getLevel2DirectoryName
setContentDisposition ( mixed $p_value ) : boolean Set the "content-disposition" HTTP header.
setDescription ( integer $p_languageId, string $p_text ) Set the description in the given language.
setLanguageId ( integer $p_value ) : boolean

메소드 상세

Attachment() 공개 메소드

public Attachment ( $p_id = null )

GetTotalAttachments() 공개 정적인 메소드

public static GetTotalAttachments ( ) : integer
리턴 integer

GetUnedited() 공개 정적인 메소드

Return the ids of the file not edited yet.
public static GetUnedited ( $p_id ) : array
리턴 array

OnFileUpload() 공개 정적인 메소드

This function should be called when an attachment is uploaded. It will save the attachment to the appropriate place on the disk, and create a database entry for the file.
public static OnFileUpload ( array $p_fileVar, array $p_attributes, integer $p_id = null, boolean $p_uploaded = false ) : mixed
$p_fileVar array
	The variable from the $_FILES array.  The array specifies the following:
$a["name"] = original name of the file.
	$a["type"] = the MIME type of the file
$a["tmp_name"] = the temporary storage location on disk of the file
$a["size"] = size of the file, in bytes (not required)
$a["error"] = 0 (zero) if there was no error
   
$p_attributes array Optional attributes which are stored in the database. Indexes can be the following: 'content_disposition', 'fk_language_id', 'http_charset', 'fk_user_id'
$p_id integer If the attachment already exists and we just want to update it, specify the current ID here.
$p_uploaded boolean If the attachment was uploaded with other mechanism (ex: plUploader) this is set so that the single upload file from article functionality is still secured.
리턴 mixed The Attachment object that was created or updated. Return a PEAR_Error on failure.

ProcessFile() 공개 정적인 메소드

Process multi-upload file.
public static ProcessFile ( string $p_tmpFile, string $p_newFile, integer $p_userId = NULL, $p_attributes = NULL ) : Image | null
$p_tmpFile string
$p_newFile string
$p_userId integer
리턴 Image | null

delete() 공개 메소드

constructor
public delete ( )

getAttachmentId() 공개 메소드

public getAttachmentId ( ) : integer
리턴 integer

getAttachmentUri() 공개 메소드

Return the full URL to the attached image.
public getAttachmentUri ( ) : string
리턴 string

getAttachmentUrl() 공개 메소드

Return the full URL to the attached image.
public getAttachmentUrl ( ) : string
리턴 string

getCharset() 공개 메소드

Return the CHARSET which should be set in the HTTP header sent to the downloader.
public getCharset ( ) : string
리턴 string

getContentDisposition() 공개 메소드

This will return either NULL or the string "attachment".
public getContentDisposition ( ) : mixed
리턴 mixed

getDescription() 공개 메소드

This is a convenience function that wraps the Translation::GetPhrase() function.
public getDescription ( integer $p_languageId ) : string
$p_languageId integer
리턴 string

getDescriptionId() 공개 메소드

Get the description ID which is an index into the Translations table.
public getDescriptionId ( ) : integer
리턴 integer

getExtension() 공개 메소드

Return the file name extension
public getExtension ( ) : string
리턴 string

getFileName() 공개 메소드

public getFileName ( ) : string
리턴 string

getLanguageId() 공개 메소드

Otherwise, it will return NULL.
public getLanguageId ( ) : integer
리턴 integer

getLastModified() 공개 메소드

fn setDescription
public getLastModified ( )

getLevel1DirectoryName() 공개 메소드

fn getStorageLocation

getLevel2DirectoryName() 공개 메소드

fn getLevel1DirectoryName

getMimeType() 공개 메소드

Return the MIME type which should be set in the HTTP header to the downloader.
public getMimeType ( ) : string
리턴 string

getSizeInBytes() 공개 메소드

Get the size of the file in bytes
public getSizeInBytes ( ) : integer
리턴 integer

getSource() 공개 메소드

public getSource ( ) : string
리턴 string

getStatus() 공개 메소드

public getStatus ( ) : string
리턴 string

getStorageLocation() 공개 메소드

Get the full path to the storage location of the file on disk.
public getStorageLocation ( ) : string
리턴 string

getTimeCreated() 공개 메소드

fn getLastModified
public getTimeCreated ( )

getUploadingUserId() 공개 메소드

public getUploadingUserId ( ) : integer
리턴 integer

inUse() 공개 메소드

Return true if the attachment is being used by an article.
public inUse ( ) : boolean
리턴 boolean

makeDirectories() 공개 메소드

fn getLevel2DirectoryName
public makeDirectories ( )

setContentDisposition() 공개 메소드

Set the "content-disposition" HTTP header.
public setContentDisposition ( mixed $p_value ) : boolean
$p_value mixed
리턴 boolean

setDescription() 공개 메소드

Set the description in the given language.
public setDescription ( integer $p_languageId, string $p_text )
$p_languageId integer
$p_text string

setLanguageId() 공개 메소드

public setLanguageId ( integer $p_value ) : boolean
$p_value integer
리턴 boolean

프로퍼티 상세

$m_columnNames 공개적으로 프로퍼티

public $m_columnNames

$m_dbTableName 공개적으로 프로퍼티

public $m_dbTableName

$m_keyColumnNames 공개적으로 프로퍼티

public $m_keyColumnNames

$m_keyIsAutoIncrement 공개적으로 프로퍼티

public $m_keyIsAutoIncrement