code: 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.');
      }
docs: Gets a DeployedFile.
  
  @param int|null $templateId   The id of the template to get. Null for the original file.
  @param string   $templateType the type of template
  @param int      $siteId       The DeploymentSite id to get the template for. If not supplied, first available will be used.
  
  @throws NotFoundException thrown if the requested deployed file does not exist
  
  @return DeploymentFile