@@ -26,22 +26,31 @@ namespace OCA\Deck\Controller;
|
||||
use OCA\Deck\Service\AttachmentService;
|
||||
use OCP\AppFramework\Controller;
|
||||
use OCP\IRequest;
|
||||
use OCA\Deck\Db\AttachmentMapper;
|
||||
|
||||
class AttachmentController extends Controller {
|
||||
|
||||
/** @var AttachmentService */
|
||||
private $attachmentService;
|
||||
private $attachmentMapper;
|
||||
|
||||
public function __construct($appName, IRequest $request, AttachmentService $attachmentService) {
|
||||
public function __construct($appName, IRequest $request, AttachmentService $attachmentService, AttachmentMapper $attachmentMapper) {
|
||||
parent::__construct($appName, $request);
|
||||
$this->attachmentService = $attachmentService;
|
||||
$this->attachmentMapper = $attachmentMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function getAll($cardId) {
|
||||
return $this->attachmentService->findAll($cardId, true);
|
||||
$attachments = $this->attachmentService->findAll($cardId, true);
|
||||
|
||||
foreach ($attachments as &$attachment) {
|
||||
$this->attachmentMapper->mapOwner($attachment);
|
||||
}
|
||||
|
||||
return $attachments;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user