transformation = $transformation; $this->publicId = $publicId; $this->text = $code; $this->type = $type; } public function getTabContent() { $url = $this->calculateUrl(); return '
' . getFormattedUrl( $url, $this->transformation ) . '
'; } private function calculateUrl() { $tag = $this->type === 'video' ? Video::upload($this->publicId) : Image::upload($this->publicId); return $tag->toUrl($this->transformation); } }