src/Controller/Reduction/SearchController.php
/**
     * @todo FindByBrand is not ready yet. Complete this one later.
     *
     * @throws Exception dateTime Emits Exception in case of an error
     */
@todo FindByBrand is not ready yet. Complete this one later.
@throws Exception dateTime Emits Exception in case of an error
@todo FindByBrand is not ready yet . Complete this one later . @throws Exception dateTime Emits Exception in case of an error
private function doSearchRequest(Request $request)
    {
        $queryParameters = $request->query->get('search');
        $page = (int) $queryParameters['page'];
        $method = $queryParameters['method'];
        return SearchType::SEARCH_METHODS[0] === $method ?
            $this->reductionRepository->findByLocation($queryParameters, $page ?? 1) :
            $this->reductionRepository->findBy(
                ['brand' => $queryParameters['brand'], 'isActive' => true],
                ['createdAt' => 'ASC']
            );
    }
private function doSearchRequest ( Request $ request ) { $ queryParameters = $ request -> query -> get ( 'search' ) ; $ page = ( int ) $ queryParameters [ 'page' ] ; $ method = $ queryParameters [ 'method' ] ; return SearchType :: SEARCH_METHODS [ 0 ] === $ method ? $ this -> reductionRepository -> findByLocation ( $ queryParameters , $ page ?? 1 ) : $ this -> reductionRepository -> findBy ( [ 'brand' => $ queryParameters [ 'brand' ] , 'isActive' => true ] , [ 'createdAt' => 'ASC' ] ) ; }
@todo FindByBrand is not ready yet.
@todo FindByBrand is not ready yet .