Xpressengine\Editor\EditorHandler::getFiles PHP Méthode

getFiles() public méthode

Get files of target used
public getFiles ( string $targetId ) : File[]
$targetId string target identifier
Résultat Xpressengine\Storage\File[]
    public function getFiles($targetId)
    {
        $data = [];
        $fileClass = $this->storage->getModel();
        $files = $fileClass::getByFileable($targetId);
        foreach ($files as $file) {
            $thumbnails = null;
            if ($this->mediaManager->is($file)) {
                $imgClass = $this->mediaManager->getHandler(Media::TYPE_IMAGE)->getModel();
                $thumbnails = $imgClass::getThumbnails($this->mediaManager->make($file), static::THUMBNAIL_TYPE);
            }
            $file->setRelation('thumbnails', $thumbnails);
            $data[] = $file;
        }
        return $data;
    }