Improve base FileModel class
This commit is contained in:
@@ -11,26 +11,12 @@ namespace Kanboard\Model;
|
||||
class TaskFileModel extends FileModel
|
||||
{
|
||||
/**
|
||||
* SQL table name
|
||||
* Table name
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const TABLE = 'task_has_files';
|
||||
|
||||
/**
|
||||
* SQL foreign key
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const FOREIGN_KEY = 'task_id';
|
||||
|
||||
/**
|
||||
* Path prefix
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const PATH_PREFIX = 'tasks';
|
||||
|
||||
/**
|
||||
* Events
|
||||
*
|
||||
@@ -38,6 +24,54 @@ class TaskFileModel extends FileModel
|
||||
*/
|
||||
const EVENT_CREATE = 'task.file.create';
|
||||
|
||||
/**
|
||||
* Get the table
|
||||
*
|
||||
* @abstract
|
||||
* @access protected
|
||||
* @return string
|
||||
*/
|
||||
protected function getTable()
|
||||
{
|
||||
return self::TABLE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the foreign key
|
||||
*
|
||||
* @abstract
|
||||
* @access protected
|
||||
* @return string
|
||||
*/
|
||||
protected function getForeignKey()
|
||||
{
|
||||
return 'task_id';
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the path prefix
|
||||
*
|
||||
* @abstract
|
||||
* @access protected
|
||||
* @return string
|
||||
*/
|
||||
protected function getPathPrefix()
|
||||
{
|
||||
return 'tasks';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get event name
|
||||
*
|
||||
* @abstract
|
||||
* @access protected
|
||||
* @return string
|
||||
*/
|
||||
protected function getEventName()
|
||||
{
|
||||
return self::EVENT_CREATE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle screenshot upload
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user