src/wcmf/application/controller/RESTController.php
public function update() {
    $this->requireTransaction();
    $request = $this->getRequest();

    $oidStr = $this->getFirstRequestOid();
    $isOrderRequest = $request->hasValue('referenceOid');
    if ($isOrderRequest) {
      // change order in all objects of the same type
      $request->setValue('insertOid', $this->getFirstRequestOid());

      // delegate to SortController
      $subResponse = $this->executeSubAction('moveBefore');

      // add sorted object to subresponse similar to default update action
      if (!$subResponse->hasErrors()) {
        $oid = ObjectId::parse($oidStr);
        $persistenceFacade = $this->getPersistenceFacade();
        $object = $persistenceFacade->load($oid);
        $subResponse->setValue('oid', $oid);
        $subResponse->setValue($oidStr, $object);
      }
    }
    else {
      // delegate to SaveController
      $subResponse = $this->executeSubAction('update');
    }

    // prevent commit
    if ($subResponse->hasErrors()) {
      $this->endTransaction(false);
    }
    $this->handleSubResponse($subResponse, $oidStr);
  }
public function update() {
    $this->requireTransaction();
    $request = $this->getRequest();

    $oidStr = $this->getFirstRequestOid();
    $isOrderRequest = $request->hasValue('referenceOid');
    if ($isOrderRequest) {
      // change order in all objects of the same type
      $request->setValue('insertOid', $this->getFirstRequestOid());

      // delegate to SortController
      $subResponse = $this->executeSubAction('moveBefore');

      // add sorted object to subresponse similar to default update action
      if (!$subResponse->hasErrors()) {
        $oid = ObjectId::parse($oidStr);
        $persistenceFacade = $this->getPersistenceFacade();
        $object = $persistenceFacade->load($oid);
        $subResponse->setValue('oid', $oid);
        $subResponse->setValue($oidStr, $object);
      }
    }
    else {
      // delegate to SaveController
      $subResponse = $this->executeSubAction('update');
    }

    // prevent commit
    if ($subResponse->hasErrors()) {
      $this->endTransaction(false);
    }
    $this->handleSubResponse($subResponse, $oidStr);
  }
public function update ( ) { $ this -> requireTransaction ( ) ; $ request = $ this -> getRequest ( ) ; $ oidStr = $ this -> getFirstRequestOid ( ) ; $ isOrderRequest = $ request -> hasValue ( 'referenceOid' ) ; if ( $ isOrderRequest ) { // change order in all objects of the same type $ request -> setValue ( 'insertOid' , $ this -> getFirstRequestOid ( ) ) ; // delegate to SortController $ subResponse = $ this -> executeSubAction ( 'moveBefore' ) ; // add sorted object to subresponse similar to default update action if ( ! $ subResponse -> hasErrors ( ) ) { $ oid = ObjectId :: parse ( $ oidStr ) ; $ persistenceFacade = $ this -> getPersistenceFacade ( ) ; $ object = $ persistenceFacade -> load ( $ oid ) ; $ subResponse -> setValue ( 'oid' , $ oid ) ; $ subResponse -> setValue ( $ oidStr , $ object ) ; } } else { // delegate to SaveController $ subResponse = $ this -> executeSubAction ( 'update' ) ; } // prevent commit if ( $ subResponse -> hasErrors ( ) ) { $ this -> endTransaction ( false ) ; } $ this -> handleSubResponse ( $ subResponse , $ oidStr ) ; }
Update an object or change the order

| Parameter        | Description
|------------------|-------------------------
| _in_ `language`  | The language of the object
| _in_ `className` | Type of object to update
| _in_ `id`        | Id of object to update
| _out_            | Updated object data

The object data is contained in POST content.
Update an object or change the order