diff options
Diffstat (limited to 'app/Model/TaskFileModel.php')
-rw-r--r-- | app/Model/TaskFileModel.php | 52 |
1 files changed, 43 insertions, 9 deletions
diff --git a/app/Model/TaskFileModel.php b/app/Model/TaskFileModel.php index 21d319b0..24c1ad4b 100644 --- a/app/Model/TaskFileModel.php +++ b/app/Model/TaskFileModel.php @@ -11,32 +11,66 @@ namespace Kanboard\Model; class TaskFileModel extends FileModel { /** - * SQL table name + * Table name * * @var string */ const TABLE = 'task_has_files'; /** - * SQL foreign key + * Events * * @var string */ - const FOREIGN_KEY = 'task_id'; + const EVENT_CREATE = 'task.file.create'; /** - * Path prefix + * Get the table * - * @var string + * @abstract + * @access protected + * @return string */ - const PATH_PREFIX = 'tasks'; + protected function getTable() + { + return self::TABLE; + } /** - * Events + * Define the foreign key * - * @var string + * @abstract + * @access protected + * @return string */ - const EVENT_CREATE = 'task.file.create'; + 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 |