InventoryController
extends AbstractController
in package
InventoryController class handles all the actions related to inventory management.
Attributes
- #[IsGranted]
- 'IS_AUTHENTICATED_FULLY'
- #[Route]
- '/inventory'
Table of Contents
Methods
- ArchiveInventory() : Response
- Method for archived a inventory
- createInventoryForAllProduct() : Response
- This method creates a new inventory for all products in stock.
- createInventoryForOneProduct() : RedirectResponse|Response
- This method creates a new inventory for a single product.
- datatable() : JsonResponse
- Provides paginated/filtered inventory (sale products) data in the DataTables server-side format.
- delete() : RedirectResponse
- Method for deleting a inventory
- desarchiveInventory() : Response
- Method for desarchived a inventory
- index() : Response
- Index route to display the list of inventories.
- indexArchive() : Response
- Index route to display the list of inventories archived.
- showDetailInventory() : Response
- Show a retail for single inventory
- update() : Response
- Method for modifiying a inventory
Methods
ArchiveInventory()
Method for archived a inventory
public
ArchiveInventory(Inventory $inventory, EntityManagerInterface $entityManager) : Response
Parameters
- $inventory : Inventory
- $entityManager : EntityManagerInterface
Attributes
- #[Route]
- '/archive/inventory/{id}'
- $name: 'inventory.archive'
Return values
ResponsecreateInventoryForAllProduct()
This method creates a new inventory for all products in stock.
public
createInventoryForAllProduct(EntityManagerInterface $entityManager, Request $request) : Response
Parameters
- $entityManager : EntityManagerInterface
- $request : Request
Attributes
- #[IsGranted]
- 'IS_AUTHENTICATED'
- #[Route]
- '/create/all'
- $name: 'inventory.create.all'
Return values
ResponsecreateInventoryForOneProduct()
This method creates a new inventory for a single product.
public
createInventoryForOneProduct(EntityManagerInterface $entityManager, Request $request) : RedirectResponse|Response
Parameters
- $entityManager : EntityManagerInterface
- $request : Request
Attributes
- #[IsGranted]
- 'IS_AUTHENTICATED'
- #[Route]
- '/create'
- $name: 'inventory.create.one'
Return values
RedirectResponse|Responsedatatable()
Provides paginated/filtered inventory (sale products) data in the DataTables server-side format.
public
datatable(EntityManagerInterface $entityManager, Request $request, DataTableService $dataTableService) : JsonResponse
Parameters
- $entityManager : EntityManagerInterface
-
Doctrine entity manager.
- $request : Request
-
Request carrying the DataTables parameters.
- $dataTableService : DataTableService
-
Service building the DataTables response.
Attributes
- #[Route]
- '/datatable'
- $name: 'inventory.datatable'
- $methods: ['GET']
Return values
JsonResponse —DataTables-compatible JSON response.
delete()
Method for deleting a inventory
public
delete(Inventory $inventory, EntityManagerInterface $doctrine) : RedirectResponse
Parameters
- $inventory : Inventory
- $doctrine : EntityManagerInterface
Attributes
- #[Route]
- '/delete/{id}'
- $name: 'inventory.delete'
Return values
RedirectResponsedesarchiveInventory()
Method for desarchived a inventory
public
desarchiveInventory(Inventory $inventory, EntityManagerInterface $entityManager) : Response
Parameters
- $inventory : Inventory
- $entityManager : EntityManagerInterface
Attributes
- #[Route]
- '/desarchive/inventory/{id}'
- $name: 'inventory.desarchive'
Return values
Responseindex()
Index route to display the list of inventories.
public
index(InventoryRepository $repository) : Response
Parameters
- $repository : InventoryRepository
Attributes
- #[IsGranted]
- 'IS_AUTHENTICATED'
- #[Route]
- '/'
- $name: 'inventory.index'
Return values
ResponseindexArchive()
Index route to display the list of inventories archived.
public
indexArchive(EntityManagerInterface $entityManager) : Response
Parameters
- $entityManager : EntityManagerInterface
Attributes
- #[Route]
- '/archive'
- $name: 'inventory.index.archive'
Return values
ResponseshowDetailInventory()
Show a retail for single inventory
public
showDetailInventory(Inventory $inventory) : Response
Parameters
- $inventory : Inventory
Attributes
- #[Route]
- '/show/inventory/{id}'
- $name: 'inventory.show.retail'
Return values
Responseupdate()
Method for modifiying a inventory
public
update(EntityManagerInterface $doctrine, Inventory $inventory, Request $request) : Response
Parameters
- $doctrine : EntityManagerInterface
- $inventory : Inventory
- $request : Request
Attributes
- #[Route]
- '/update/{id}'
- $name: 'inventory.update'