diff options
Diffstat (limited to 'app/Model/ProjectFileModel.php')
-rw-r--r-- | app/Model/ProjectFileModel.php | 52 |
1 files changed, 43 insertions, 9 deletions
diff --git a/app/Model/ProjectFileModel.php b/app/Model/ProjectFileModel.php index 2177df27..b464bb2a 100644 --- a/app/Model/ProjectFileModel.php +++ b/app/Model/ProjectFileModel.php @@ -11,30 +11,64 @@ namespace Kanboard\Model; class ProjectFileModel extends FileModel { /** - * SQL table name + * Table name * * @var string */ const TABLE = 'project_has_files'; /** - * SQL foreign key + * Events * * @var string */ - const FOREIGN_KEY = 'project_id'; + const EVENT_CREATE = 'project.file.create'; /** - * Path prefix + * Get the table * - * @var string + * @abstract + * @access protected + * @return string */ - const PATH_PREFIX = 'projects'; + protected function getTable() + { + return self::TABLE; + } /** - * Events + * Define the foreign key * - * @var string + * @abstract + * @access protected + * @return string */ - const EVENT_CREATE = 'project.file.create'; + protected function getForeignKey() + { + return 'project_id'; + } + + /** + * Define the path prefix + * + * @abstract + * @access protected + * @return string + */ + protected function getPathPrefix() + { + return 'projects'; + } + + /** + * Get event name + * + * @abstract + * @access protected + * @return string + */ + protected function getEventName() + { + return self::EVENT_CREATE; + } } |