src/wcmf/application/controller/CopyController.php
protected function updateCopyOIDs(array $oidMap) {
    $registry = $this->getLocalSessionValue(self::OBJECT_MAP_VAR);
    // registry maybe deleted already if it's the last step
    if ($registry) {
      $flippedRegistry = array_flip($registry);
      foreach ($oidMap as $oldOid => $newOid) {
        if (isset($flippedRegistry[$oldOid])) {
          $key = $flippedRegistry[$oldOid];
          unset($flippedRegistry[$oldOid]);
          $flippedRegistry[$newOid] = $key;
        }
      }
      $registry = array_flip($flippedRegistry);
      $this->setLocalSessionValue(self::OBJECT_MAP_VAR, $registry);
    }
  }
protected function updateCopyOIDs(array $oidMap) {
    $registry = $this->getLocalSessionValue(self::OBJECT_MAP_VAR);
    // registry maybe deleted already if it's the last step
    if ($registry) {
      $flippedRegistry = array_flip($registry);
      foreach ($oidMap as $oldOid => $newOid) {
        if (isset($flippedRegistry[$oldOid])) {
          $key = $flippedRegistry[$oldOid];
          unset($flippedRegistry[$oldOid]);
          $flippedRegistry[$newOid] = $key;
        }
      }
      $registry = array_flip($flippedRegistry);
      $this->setLocalSessionValue(self::OBJECT_MAP_VAR, $registry);
    }
  }
protected function updateCopyOIDs ( array $ oidMap ) { $ registry = $ this -> getLocalSessionValue ( self :: OBJECT_MAP_VAR ) ; // registry maybe deleted already if it's the last step if ( $ registry ) { $ flippedRegistry = array_flip ( $ registry ) ; foreach ( $ oidMap as $ oldOid => $ newOid ) { if ( isset ( $ flippedRegistry [ $ oldOid ] ) ) { $ key = $ flippedRegistry [ $ oldOid ] ; unset ( $ flippedRegistry [ $ oldOid ] ) ; $ flippedRegistry [ $ newOid ] = $ key ; } } $ registry = array_flip ( $ flippedRegistry ) ; $ this -> setLocalSessionValue ( self :: OBJECT_MAP_VAR , $ registry ) ; } }
Update the copied object ids in the registry
@param $oidMap Map of changed object ids (key: old value, value: new value)
Update the copied object ids in the registry