芝麻web文件管理V1.00
编辑当前文件:/home/mgatv524/cms.mgaplay.com.br/lib/Listener/OnFolderMoving/DisplayGroupListener.php
. */ namespace Xibo\Listener\OnFolderMoving; use Xibo\Event\FolderMovingEvent; use Xibo\Factory\DisplayGroupFactory; class DisplayGroupListener { /** * @var DisplayGroupFactory */ private $displayGroupFactory; public function __construct(DisplayGroupFactory $displayGroupFactory) { $this->displayGroupFactory = $displayGroupFactory; } public function __invoke(FolderMovingEvent $event) { $folder = $event->getFolder(); $newFolder = $event->getNewFolder(); foreach ($this->displayGroupFactory->getbyFolderId($folder->getId()) as $displayGroup) { $displayGroup->folderId = $newFolder->getId(); $displayGroup->permissionsFolderId = $newFolder->getPermissionFolderIdOrThis(); $displayGroup->updateFolders('displaygroup'); } } }