updateKey() public method

Update key
public updateKey ( string $old, string $new ) : void
$old string
$new string
return void
Exemplo n.º 1
0
 /**
  * Rename item
  *
  * @param string $src
  * @param string $dest
  * @return void
  * @throws InvalidArgumentException
  */
 public function renameItem($src, $dest)
 {
     try {
         $name = basename($dest);
         $dest = ltrim(dirname($src) . $name, './');
         $this->storage->renameItem($src, $name);
         $this->repository->updateKey($src, $dest);
     } catch (\InvalidArgumentException $e) {
         throw new \InvalidArgumentException(sprintf('The template object %s could not be renamed.', basename($src)), $e->getCode(), $e);
     }
 }