|
<?php |
|
|
|
namespace Kanboard\Model; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ProjectFileModel extends FileModel |
|
{ |
|
|
|
|
|
|
|
|
|
|
|
const TABLE = 'project_has_files'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
const EVENT_CREATE = 'project.file.create'; |
|
const EVENT_DESTROY = 'project.file.destroy'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected function getTable() |
|
{ |
|
return self::TABLE; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected function getForeignKey() |
|
{ |
|
return 'project_id'; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected function getPathPrefix() |
|
{ |
|
return 'projects'; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected function fireCreationEvent($file_id) |
|
{ |
|
$this->queueManager->push($this->projectFileEventJob->withParams($file_id, self::EVENT_CREATE)); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected function fireDestructionEvent($file_id) |
|
{ |
|
$this->queueManager->push($this->projectFileEventJob->withParams($file_id, self::EVENT_DESTROY)); |
|
} |
|
} |
|
|