public function setRecordCollectionAction(Request $request, $databox_id, $record_id)
    {
        $databox = $this->findDataboxById($databox_id);
        $record = $databox->get_record($record_id);

        try {
            $collection = \collection::getByBaseId($this->app, $request->get('base_id'));
            $record->move_to_collection($collection, $this->getApplicationBox());

            return Result::create($request, ["record" => $this->listRecord($request, $record)])->createResponse();
        } catch (\Exception $e) {
            return $this->getBadRequestAction($request, $e->getMessage());
        }
    }
public function setRecordCollectionAction(Request $request, $databox_id, $record_id)
    {
        $databox = $this->findDataboxById($databox_id);
        $record = $databox->get_record($record_id);

        try {
            $collection = \collection::getByBaseId($this->app, $request->get('base_id'));
            $record->move_to_collection($collection, $this->getApplicationBox());

            return Result::create($request, ["record" => $this->listRecord($request, $record)])->createResponse();
        } catch (\Exception $e) {
            return $this->getBadRequestAction($request, $e->getMessage());
        }
    }
public function setRecordCollectionAction ( Request $ request , $ databox_id , $ record_id ) { $ databox = $ this -> findDataboxById ( $ databox_id ) ; $ record = $ databox -> get_record ( $ record_id ) ; try { $ collection = \ collection :: getByBaseId ( $ this -> app , $ request -> get ( 'base_id' ) ) ; $ record -> move_to_collection ( $ collection , $ this -> getApplicationBox ( ) ) ; return Result :: create ( $ request , [ "record" => $ this -> listRecord ( $ request , $ record ) ] ) -> createResponse ( ) ; } catch ( \ Exception $ e ) { return $ this -> getBadRequestAction ( $ request , $ e -> getMessage ( ) ) ; } }
Move a record to another collection

@param  Request $request
@param  int     $databox_id
@param  int     $record_id

@return Response
Move a record to another collection