public function updateDatabaseCGU(Request $request, $databox_id)
    {
        $databox = $this->findDataboxById($databox_id);

        try {
            foreach ($request->request->get('TOU', []) as $loc => $terms) {
                $databox->update_cgus($loc, $terms, !!$request->request->get('valid', false));
            }
        } catch (\Exception $e) {
            return $this->app->redirectPath('admin_database_display_cgus', [
                'databox_id' => $databox_id,
                'success'    => 0,
            ]);
        }

        return $this->app->redirectPath('admin_database_display_cgus', [
            'databox_id' => $databox_id,
            'success'    => 1,
        ]);
    }
public function updateDatabaseCGU(Request $request, $databox_id)
    {
        $databox = $this->findDataboxById($databox_id);

        try {
            foreach ($request->request->get('TOU', []) as $loc => $terms) {
                $databox->update_cgus($loc, $terms, !!$request->request->get('valid', false));
            }
        } catch (\Exception $e) {
            return $this->app->redirectPath('admin_database_display_cgus', [
                'databox_id' => $databox_id,
                'success'    => 0,
            ]);
        }

        return $this->app->redirectPath('admin_database_display_cgus', [
            'databox_id' => $databox_id,
            'success'    => 1,
        ]);
    }
public function updateDatabaseCGU ( Request $ request , $ databox_id ) { $ databox = $ this -> findDataboxById ( $ databox_id ) ; try { foreach ( $ request -> request -> get ( 'TOU' , [ ] ) as $ loc => $ terms ) { $ databox -> update_cgus ( $ loc , $ terms , ! ! $ request -> request -> get ( 'valid' , false ) ) ; } } catch ( \ Exception $ e ) { return $ this -> app -> redirectPath ( 'admin_database_display_cgus' , [ 'databox_id' => $ databox_id , 'success' => 0 , ] ) ; } return $ this -> app -> redirectPath ( 'admin_database_display_cgus' , [ 'databox_id' => $ databox_id , 'success' => 1 , ] ) ; }
Update databox CGU's

@param  Request          $request    The current HTTP request
@param  integer          $databox_id The requested databox
@return RedirectResponse
Update databox CGU s