mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-27 20:28:54 +02:00
Moved attachment related services into their own namespaces
This commit is contained in:
parent
f5f581293a
commit
c955a3a221
16 changed files with 33 additions and 33 deletions
|
@ -37,7 +37,7 @@ use App\Entity\UserSystem\User;
|
|||
use App\Exceptions\AttachmentDownloadException;
|
||||
use App\Form\AdminPages\ImportType;
|
||||
use App\Form\AdminPages\MassCreationForm;
|
||||
use App\Services\AttachmentHelper;
|
||||
use App\Services\Attachments\AttachmentManager;
|
||||
use App\Services\Attachments\AttachmentSubmitHandler;
|
||||
use App\Services\EntityExporter;
|
||||
use App\Services\EntityImporter;
|
||||
|
@ -69,7 +69,7 @@ abstract class BaseAdminController extends AbstractController
|
|||
protected $attachmentSubmitHandler;
|
||||
|
||||
public function __construct(TranslatorInterface $translator, UserPasswordEncoderInterface $passwordEncoder,
|
||||
AttachmentHelper $attachmentHelper, AttachmentSubmitHandler $attachmentSubmitHandler)
|
||||
AttachmentManager $attachmentHelper, AttachmentSubmitHandler $attachmentSubmitHandler)
|
||||
{
|
||||
if ($this->entity_class === '' || $this->form_class === '' || $this->twig_template === '' || $this->route_base === '') {
|
||||
throw new \InvalidArgumentException('You have to override the $entity_class, $form_class, $route_base and $twig_template value in your subclasss!');
|
||||
|
|
|
@ -36,7 +36,7 @@ use App\DataTables\AttachmentDataTable;
|
|||
use App\DataTables\PartsDataTable;
|
||||
use App\Entity\Attachments\Attachment;
|
||||
use App\Entity\Attachments\PartAttachment;
|
||||
use App\Services\AttachmentHelper;
|
||||
use App\Services\Attachments\AttachmentManager;
|
||||
use Omines\DataTablesBundle\DataTableFactory;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
||||
|
@ -52,11 +52,11 @@ class AttachmentFileController extends AbstractController
|
|||
*
|
||||
* @Route("/attachment/{id}/download", name="attachment_download")
|
||||
* @param Attachment $attachment
|
||||
* @param AttachmentHelper $helper
|
||||
* @param AttachmentManager $helper
|
||||
* @return BinaryFileResponse
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function download(Attachment $attachment, AttachmentHelper $helper)
|
||||
public function download(Attachment $attachment, AttachmentManager $helper)
|
||||
{
|
||||
$this->denyAccessUnlessGranted('read', $attachment);
|
||||
|
||||
|
@ -83,11 +83,11 @@ class AttachmentFileController extends AbstractController
|
|||
*
|
||||
* @Route("/attachment/{id}/view", name="attachment_view")
|
||||
* @param Attachment $attachment
|
||||
* @param AttachmentHelper $helper
|
||||
* @param AttachmentManager $helper
|
||||
* @return BinaryFileResponse
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function view(Attachment $attachment, AttachmentHelper $helper)
|
||||
public function view(Attachment $attachment, AttachmentManager $helper)
|
||||
{
|
||||
$this->denyAccessUnlessGranted('read', $attachment);
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ use App\Entity\Parts\Category;
|
|||
use App\Entity\Parts\Part;
|
||||
use App\Exceptions\AttachmentDownloadException;
|
||||
use App\Form\Part\PartBaseType;
|
||||
use App\Services\AttachmentHelper;
|
||||
use App\Services\Attachments\AttachmentManager;
|
||||
use App\Services\Attachments\AttachmentSubmitHandler;
|
||||
use App\Services\Attachments\PartPreviewGenerator;
|
||||
use App\Services\PricedetailHelper;
|
||||
|
@ -55,10 +55,10 @@ class PartController extends AbstractController
|
|||
* @Route("/{id}/info", name="part_info")
|
||||
* @Route("/{id}", requirements={"id"="\d+"})
|
||||
* @param Part $part
|
||||
* @param AttachmentHelper $attachmentHelper
|
||||
* @param AttachmentManager $attachmentHelper
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function show(Part $part, AttachmentHelper $attachmentHelper, PricedetailHelper $pricedetailHelper, PartPreviewGenerator $previewGenerator)
|
||||
public function show(Part $part, AttachmentManager $attachmentHelper, PricedetailHelper $pricedetailHelper, PartPreviewGenerator $previewGenerator)
|
||||
{
|
||||
$this->denyAccessUnlessGranted('read', $part);
|
||||
|
||||
|
@ -83,7 +83,7 @@ class PartController extends AbstractController
|
|||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function edit(Part $part, Request $request, EntityManagerInterface $em, TranslatorInterface $translator,
|
||||
AttachmentHelper $attachmentHelper, AttachmentSubmitHandler $attachmentSubmitHandler)
|
||||
AttachmentManager $attachmentHelper, AttachmentSubmitHandler $attachmentSubmitHandler)
|
||||
{
|
||||
$this->denyAccessUnlessGranted('edit', $part);
|
||||
|
||||
|
@ -161,7 +161,7 @@ class PartController extends AbstractController
|
|||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function new(Request $request, EntityManagerInterface $em, TranslatorInterface $translator,
|
||||
AttachmentHelper $attachmentHelper, AttachmentSubmitHandler $attachmentSubmitHandler)
|
||||
AttachmentManager $attachmentHelper, AttachmentSubmitHandler $attachmentSubmitHandler)
|
||||
{
|
||||
$new_part = new Part();
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
namespace App\Controller;
|
||||
|
||||
|
||||
use App\Services\BuiltinAttachmentsFinder;
|
||||
use App\Services\Attachments\BuiltinAttachmentsFinder;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue