public function getDeployedFile($templateId, $templateType = self::TEMPLATE_IMAGE, $siteId = null)
    {
        foreach ($this->deployedFiles as $deployedFile) {
            /** @var DeploymentFile $deployedFile */
            if (null === $siteId || $siteId == $deployedFile->getDeployMentSiteId()) {
                if (self::TEMPLATE_VIDEO == $templateType) {
                    if ($templateId == $deployedFile->getVideoTemplateId() && null === $deployedFile->getImageTemplateId()) {
                        return $deployedFile;
                    }
                } elseif (self::TEMPLATE_IMAGE == $templateType && $templateId == $deployedFile->getImageTemplateId() ||
                    (null === $templateId && null === $deployedFile->getImageTemplateId() && null === $deployedFile->getVideoTemplateId())) {
                    return $deployedFile;
                }
            }
        }
        throw new NotFoundException('No DeploymentFile with the id "' . $templateId . '" exists.');
    }