phpDocumentor Testlink
[ class tree: Testlink ] [ index: Testlink ] [ all elements ]

Class: tlAttachmentRepository

Source Location: /attachmentrepository.class.php

Class tlAttachmentRepository

Property Summary
mixed   $attachmentCfg  
mixed   $repositoryPath  

[ Top ]
Method Summary
static void   create()  
tlAttachmentRepository   __construct()  
string   buildRepositoryFilePath()   Builds the path for a given filename according to the tablename and id
string   buildRepositoryFolderFor()   Builds the repository folder for the attachment
void   deleteAttachment()  
void   deleteAttachmentFromDB()  
void   deleteAttachmentFromFS()  
void   deleteAttachmentsFor()  
void   getAttachmentContent()  
string   getAttachmentContentFromDB()   Gets some common infos about attachments
void   getAttachmentContentFromFS()  
void   getAttachmentIDsFor()  
void   getAttachmentInfo()  
void   getAttachmentInfosFor()  
string   getFileContentsForDBRepository()   Fetches the contents of a file for storing it into the DB-repository
int   insertAttachment()   Inserts the information about an attachment into the db
bool   storeFileInFSRepository()   Stores a file into the FS-repository

[ Top ]
Properties
mixed   $attachmentCfg [line 27]
API Tags:
Access:  protected


[ Top ]
mixed   $repositoryPath [line 26]
API Tags:
Access:  protected


[ Top ]
Methods
static method create  [line 43]

  static void create( &$db  )

Parameters:
   &$db: 

API Tags:
Access:  public


[ Top ]
Constructor __construct  [line 30]

  tlAttachmentRepository __construct( &$db  )

Parameters:
   &$db: 


Redefinition of:
tlObjectWithDB::__construct()

[ Top ]
buildRepositoryFilePath  [line 113]

  string buildRepositoryFilePath( string $destFName, string $tableName, int $id  )

Builds the path for a given filename according to the tablename and id

Parameters:
string   $destFName:  the fileName
string   $tableName:  the tablename to which $id referes to (attachments.fk_table)
int   $id:  the foreign key id attachments.fk_id)

API Tags:
Return:  returns the full path for the file
Access:  public


[ Top ]
buildRepositoryFolderFor  [line 186]

  string buildRepositoryFolderFor( string $tableName, int $id, [bool $mkDir = false]  )

Builds the repository folder for the attachment

Parameters:
string   $tableName:  the tablename to which $id referes to (attachments.fk_table)
int   $id:  the foreign key id attachments.fk_id)
bool   $mkDir:  if true then the the directory will be created, else not

API Tags:
Return:  returns the full path for the folder
Access:  public


[ Top ]
deleteAttachment  [line 212]

  void deleteAttachment( $id, [ $attachmentInfo = null]  )

Parameters:
   $id: 
   $attachmentInfo: 

API Tags:
Access:  public


[ Top ]
deleteAttachmentFromDB  [line 206]

  void deleteAttachmentFromDB( $id, [ $dummy = null]  )

Parameters:
   $id: 
   $dummy: 

API Tags:
Access:  protected


[ Top ]
deleteAttachmentFromFS  [line 198]

  void deleteAttachmentFromFS( $dummy, [ $attachmentInfo = null]  )

Parameters:
   $dummy: 
   $attachmentInfo: 

API Tags:
Access:  protected


[ Top ]
deleteAttachmentsFor  [line 295]

  void deleteAttachmentsFor( $fkid, $fkTableName  )

Parameters:
   $fkid: 
   $fkTableName: 

API Tags:
Access:  public


[ Top ]
getAttachmentContent  [line 226]

  void getAttachmentContent( $id, [ $attachmentInfo = null]  )

Parameters:
   $id: 
   $attachmentInfo: 

API Tags:
Access:  public


[ Top ]
getAttachmentContentFromDB  [line 273]

  string getAttachmentContentFromDB( int $id  )

Gets some common infos about attachments

Parameters:
int   $id:  the id of the attachment (attachments.id)

API Tags:
Return:  returns the contents of the attachment
Access:  public


[ Top ]
getAttachmentContentFromFS  [line 241]

  void getAttachmentContentFromFS( $id  )

Parameters:
   $id: 

API Tags:
Access:  protected


[ Top ]
getAttachmentIDsFor  [line 334]

  void getAttachmentIDsFor( $fkid, $fkTableName  )

Parameters:
   $fkid: 
   $fkTableName: 

API Tags:
Access:  public


[ Top ]
getAttachmentInfo  [line 313]

  void getAttachmentInfo( $id  )

Parameters:
   $id: 

API Tags:
Access:  public


[ Top ]
getAttachmentInfosFor  [line 322]

  void getAttachmentInfosFor( $fkid, $fkTableName  )

Parameters:
   $fkid: 
   $fkTableName: 

API Tags:
Access:  public


[ Top ]
getFileContentsForDBRepository  [line 129]

  string getFileContentsForDBRepository( string $fTmpName, string $destFName  )

Fetches the contents of a file for storing it into the DB-repository

Parameters:
string   $fTmpName:  the filename of the attachment
string   $destFName:  a unique file name for temporary usage

API Tags:
Return:  the contents of the attachment to be stored into the db
Access:  protected


[ Top ]
insertAttachment  [line 65]

  int insertAttachment( int $fkid, $fkTableName, string $title, array $fInfo, string $fktableName  )

Inserts the information about an attachment into the db

Parameters:
int   $fkid:  the foreign key id (attachments.fk_id)
string   $fktableName:  the tablename to which the $id refers to (attachments.fk_table)
string   $title:  the title used for the attachment
array   $fInfo:  should be $_FILES in most cases
   $fkTableName: 

API Tags:
Return:  returns true if the information was successfully stored, false else
Access:  public


[ Top ]
storeFileInFSRepository  [line 160]

  bool storeFileInFSRepository( string $fTmpName, &$destFPath, string $destFPath  )

Stores a file into the FS-repository

Parameters:
string   $fTmpName:  the filename
string   $destFPath:  [ref] the destination file name
   &$destFPath: 

API Tags:
Return:  returns true if the file was uploaded, false else
Access:  protected


[ Top ]

Documentation generated on Fri, 03 Apr 2009 14:13:45 +0200 by phpDocumentor 1.4.1