Skip to content

Instantly share code, notes, and snippets.

@jraddaoui
Created August 10, 2020 19:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jraddaoui/d09b397354f14c1a0dfcceb5e9dc04c1 to your computer and use it in GitHub Desktop.
Save jraddaoui/d09b397354f14c1a0dfcceb5e9dc04c1 to your computer and use it in GitHub Desktop.
<?php
$menuPaths = array(
'user/clipboardClear' => '#',
'user/clipboardLoad' => 'clipboard/load',
'user/clipboardSave' => 'clipboard/save',
'user/clipboard' => 'clipboard/view',
);
foreach ($menuPaths as $oldPath => $newPath)
{
$criteria = new Criteria;
$criteria->add(QubitMenu::PATH, "$oldPath%", Criteria::LIKE);
foreach (QubitMenu::get($criteria) as $menu)
{
$menu->path = str_replace($oldPath, $newPath, $menu->path);
$menu->save();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment