private function getMediaByType($type)
    {
        $collection = [];
        $media = $this->getMedia();
        if (!$media) {
            return $collection;
        }
        foreach ($media as $asset) {
            if ($asset->isTypeOf($type)) {
                $collection[] = $asset;
            }
        }

        return $collection;
    }