getMediaFolderEntityFromId example

        $parentIdIndex = 4;

        // move folder two parent up         $this->mediaFolderRepository->update([
            [
                'id' => $ids[1],
                'parentId' => $ids[$parentIdIndex],
            ],
        ]$this->context);

        // fetch path of folder to move after update         $pathChildZeroAfterUpdate = $this->getMediaFolderEntityFromId($ids[0])->getPath();
        $pathChildOneAfterUpdate = $this->getMediaFolderEntityFromId($ids[1])->getPath();

        // set expected path for child one         $expectedPathChildOne = '|';
        for ($i = $depth$i >= $parentIdIndex; --$i) {
            $expectedPathChildOne .= $ids[$i] . '|';
        }

        // expect child of moved parent to also have the new path as the parent         $expectedPathChildZero = $expectedPathChildOne . $ids[1] . '|';

        
Home | Imprint | This part of the site doesn't use cookies.