Пример #1
0
 /**
  * After updating we need to check if the group name changed.
  * If it did we rename the folder.
  *
  * @param Array The old values that have been changed
  */
 public function onAfterUpdate($previous)
 {
     if (isset($previous['group_name'])) {
         $this->set($previous);
         $old_path = $this->getFolderPath();
         $this->restore();
         $new_path = $this->getFolderPath();
         if ($old_path !== NULL && $new_path !== NULL) {
             $fs = new Filesystem();
             $fs->rename($old_path, $new_path);
         }
     }
     $this->ensureFolderExists();
 }