public function setOrderAdmins(Request $request, $bas_id)
    {
        $admins = array_filter(
            array_values($request->request->get('admins', [])),
            function ($value) { return $value != false; }
        );

        if (false && count($admins) === 0) {
            $this->app->abort(400, 'No admins provided.');
        }

        if (!is_array($admins)) {
            $this->app->abort(400, 'Admins must be an array.');
        }

        $collection = $this->getApplicationBox()->get_collection($bas_id);
        $collectionReference = $collection->getReference();

        $this->collectionService->setOrderMasters($collectionReference, $admins);

        return $this->app->redirectPath('admin_display_collection', [
            'bas_id'  => $bas_id,
            'success' => 1,
        ]);
    }
public function setOrderAdmins(Request $request, $bas_id)
    {
        $admins = array_filter(
            array_values($request->request->get('admins', [])),
            function ($value) { return $value != false; }
        );

        if (false && count($admins) === 0) {
            $this->app->abort(400, 'No admins provided.');
        }

        if (!is_array($admins)) {
            $this->app->abort(400, 'Admins must be an array.');
        }

        $collection = $this->getApplicationBox()->get_collection($bas_id);
        $collectionReference = $collection->getReference();

        $this->collectionService->setOrderMasters($collectionReference, $admins);

        return $this->app->redirectPath('admin_display_collection', [
            'bas_id'  => $bas_id,
            'success' => 1,
        ]);
    }
public function setOrderAdmins ( Request $ request , $ bas_id ) { $ admins = array_filter ( array_values ( $ request -> request -> get ( 'admins' , [ ] ) ) , function ( $ value ) { return $ value != false ; } ) ; if ( false && count ( $ admins ) === 0 ) { $ this -> app -> abort ( 400 , 'No admins provided.' ) ; } if ( ! is_array ( $ admins ) ) { $ this -> app -> abort ( 400 , 'Admins must be an array.' ) ; } $ collection = $ this -> getApplicationBox ( ) -> get_collection ( $ bas_id ) ; $ collectionReference = $ collection -> getReference ( ) ; $ this -> collectionService -> setOrderMasters ( $ collectionReference , $ admins ) ; return $ this -> app -> redirectPath ( 'admin_display_collection' , [ 'bas_id' => $ bas_id , 'success' => 1 , ] ) ; }
Set new admin to handle orders

@param  Request $request The current request
@param  integer $bas_id  The collection base_id
@return Response
@throws \Doctrine\DBAL\ConnectionException
@throws \Exception
Set new admin to handle orders