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