diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 8dacb10..e81f6b4 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -184,7 +184,7 @@ final class ApiController extends Controller return $element; } - $item = ItemMapper::withConditional('language', $response->getLanguage())::get($element->item); + $item = ItemMapper::with('language', $response->getLanguage())::get($element->item); // @todo: which item name should be stored in the database? server language (problem for international company with subsidiaries)? customer default language/customer invoice language? $element->itemNumber = $item->number; $element->itemName = $item->getL11n('name1')->description; diff --git a/Controller/BackendController.php b/Controller/BackendController.php index eb22510..c44e400 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -53,17 +53,17 @@ final class BackendController extends Controller if ($request->getData('ptype') === 'p') { $view->setData('bills', - SalesBillMapper::withConditional('language', $response->getLanguage(), [BillTypeL11n::class]) + SalesBillMapper::with('language', $response->getLanguage(), [BillTypeL11n::class]) ::getSalesBeforePivot((int) ($request->getData('id') ?? 0), limit: 25, depth: 3) ); } elseif ($request->getData('ptype') === 'n') { $view->setData('bills', - SalesBillMapper::withConditional('language', $response->getLanguage(), [BillTypeL11n::class]) + SalesBillMapper::with('language', $response->getLanguage(), [BillTypeL11n::class]) ::getSalesAfterPivot((int) ($request->getData('id') ?? 0), limit: 25, depth: 3) ); } else { $view->setData('bills', - SalesBillMapper::withConditional('language', $response->getLanguage(), [BillTypeL11n::class]) + SalesBillMapper::with('language', $response->getLanguage(), [BillTypeL11n::class]) ::getSalesAfterPivot(0, limit: 25, depth: 3) ); } @@ -137,17 +137,17 @@ final class BackendController extends Controller if ($request->getData('ptype') === 'p') { $view->setData('bills', - PurchaseBillMapper::withConditional('language', $response->getLanguage(), [BillTypeL11n::class]) + PurchaseBillMapper::with('language', $response->getLanguage(), [BillTypeL11n::class]) ::getPurchaseBeforePivot((int) ($request->getData('id') ?? 0), limit: 25, depth: 3) ); } elseif ($request->getData('ptype') === 'n') { $view->setData('bills', - PurchaseBillMapper::withConditional('language', $response->getLanguage(), [BillTypeL11n::class]) + PurchaseBillMapper::with('language', $response->getLanguage(), [BillTypeL11n::class]) ::getPurchaseAfterPivot((int) ($request->getData('id') ?? 0), limit: 25, depth: 3) ); } else { $view->setData('bills', - PurchaseBillMapper::withConditional('language', $response->getLanguage(), [BillTypeL11n::class]) + PurchaseBillMapper::with('language', $response->getLanguage(), [BillTypeL11n::class]) ::getPurchaseAfterPivot(0, limit: 25, depth: 3) ); } @@ -200,17 +200,17 @@ final class BackendController extends Controller if ($request->getData('ptype') === 'p') { $view->setData('bills', - StockBillMapper::withConditional('language', $response->getLanguage(), [BillTypeL11n::class]) + StockBillMapper::with('language', $response->getLanguage(), [BillTypeL11n::class]) ::getStockBeforePivot((int) ($request->getData('id') ?? 0), limit: 25, depth: 3) ); } elseif ($request->getData('ptype') === 'n') { $view->setData('bills', - StockBillMapper::withConditional('language', $response->getLanguage(), [BillTypeL11n::class]) + StockBillMapper::with('language', $response->getLanguage(), [BillTypeL11n::class]) ::getStockAfterPivot((int) ($request->getData('id') ?? 0), limit: 25, depth: 3) ); } else { $view->setData('bills', - StockBillMapper::withConditional('language', $response->getLanguage(), [BillTypeL11n::class]) + StockBillMapper::with('language', $response->getLanguage(), [BillTypeL11n::class]) ::getStockAfterPivot(0, limit: 25, depth: 3) ); }