当前位置: 首页>>代码示例>>PHP>>正文


PHP Asset::getRepository方法代码示例

本文整理汇总了PHP中Asset::getRepository方法的典型用法代码示例。如果您正苦于以下问题:PHP Asset::getRepository方法的具体用法?PHP Asset::getRepository怎么用?PHP Asset::getRepository使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Asset的用法示例。


在下文中一共展示了Asset::getRepository方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getUrlParams

 /**
  * Answer a list of parameters to pass through urls
  * 
  * @return array
  * @access public
  * @since 10/16/07
  */
 public static function getUrlParams(Asset $asset)
 {
     $repository = $asset->getRepository();
     $params = array("collection_id" => $repository->getId()->getIdString(), "asset_id" => $asset->getId()->getIdString(), RequestContext::name("starting_number") => RequestContext::value("starting_number"), RequestContext::name("limit_by_type") => RequestContext::value("limit_by_type"), RequestContext::name("order") => RequestContext::value("order"), RequestContext::name("direction") => RequestContext::value("direction"), RequestContext::name("type") => RequestContext::value("type"), RequestContext::name("searchtype") => RequestContext::value("searchtype"));
     if (RequestContext::value("searchtype")) {
         $searchModuleManager = Services::getService("RepositorySearchModules");
         foreach ($searchModuleManager->getCurrentValues(HarmoniType::fromString(RequestContext::value("searchtype"))) as $key => $value) {
             $params[$key] = $value;
         }
     }
     // if we are limiting by type
     if (RequestContext::value("limit_by_type") == 'true') {
         $types = $repository->getAssetTypes();
         $selectedTypes = array();
         while ($types->hasNext()) {
             $type = $types->next();
             if (RequestContext::value("type___" . $type->asString()) == 'true') {
                 $params[RequestContext::name("type___" . $type->asString())] = RequestContext::value("type___" . $type->asString());
             }
         }
     }
     return $params;
 }
开发者ID:adamfranco,项目名称:concerto,代码行数:30,代码来源:AssetPrinter.static.php

示例2: createForContentAsset

 /**
  * Create a new Asset attached to a content asset. To access this asset as
  * a mediaAsset, use 
  * 		MediaAsset::withAsset(MediaAsset::createForContentAsset($contentAsset));
  * 
  * @param object Asset $contentAsset
  * @return object Asset
  * @access public
  * @since 1/24/08
  * @static
  */
 public static function createForContentAsset(Asset $contentAsset)
 {
     $repository = $contentAsset->getRepository();
     // Create the asset
     $asset = $repository->createAsset("Untitled", '', self::getMediaFileType());
     $contentAsset->addAsset($asset->getId());
     return $asset;
 }
开发者ID:adamfranco,项目名称:segue,代码行数:19,代码来源:MediaAsset.class.php

示例3: forAsset

 /**
  * Create an instance of the Director for a particular Asset
  * 
  * @param object Asset $asset
  * @return object AssetSiteDirector
  * @access public
  * @since 10/25/07
  * @static
  */
 public static function forAsset(Asset $asset)
 {
     return new AssetSiteDirector($asset->getRepository());
 }
开发者ID:adamfranco,项目名称:segue,代码行数:13,代码来源:AssetSiteDirector.class.php

示例4: printAssetXML

 /**
  * Function for printing the asset block of the slideshow XML file
  * 
  * @param object Asset $asset
  * @param optional object Id $recordId
  * @return void
  * @access public
  * @since 10/14/05
  */
 function printAssetXML(Asset $asset, Id $recordId = null)
 {
     $assetId = $asset->getId();
     $repository = $asset->getRepository();
     $repositoryId = $repository->getId();
     $idManager = Services::getService("Id");
     // ------------------------------------------
     print "\t<slide>\n";
     // Title
     print "\t\t<title><![CDATA[";
     print htmlspecialchars($asset->getDisplayName(), ENT_COMPAT, 'UTF-8');
     print "]]></title>\n";
     // Caption
     print "\t\t<caption><![CDATA[";
     $this->printAsset($asset);
     print "]]></caption>\n";
     // Text-Position
     print "\t\t<text-position>";
     print "right";
     print "</text-position>\n";
     $fileRecords = new MultiIteratorIterator();
     $fileRecords->addIterator($asset->getRecordsByRecordStructure($idManager->getId("FILE")));
     $fileRecords->addIterator($asset->getRecordsByRecordStructure($idManager->getId("REMOTE_FILE")));
     /*********************************************************
      * Files
      *********************************************************/
     $harmoni = Harmoni::instance();
     $harmoni->request->startNamespace("polyphony-repository");
     $imgProcessor = Services::getService("ImageProcessor");
     while ($fileRecords->hasNext()) {
         $this->printFileRecord($fileRecords->next(), $repositoryId, $assetId);
     }
     $harmoni->request->endNamespace();
     print "\t</slide>\n";
 }
开发者ID:adamfranco,项目名称:concerto,代码行数:44,代码来源:browse_slide_xml.act.php

示例5: printAssetXML

 /**
  * Function for printing the asset block of the slideshow XML file
  * 
  * @param object Asset $asset
  * @param optional object Id $recordId
  * @return void
  * @access public
  * @since 10/14/05
  */
 function printAssetXML(Asset $asset, Id $recordId = null)
 {
     $harmoni = Harmoni::instance();
     $assetId = $asset->getId();
     $repository = $asset->getRepository();
     $repositoryId = $repository->getId();
     $idManager = Services::getService("Id");
     // ------------------------------------------
     print "\t<slide>\n";
     // Title
     print "\t\t<title><![CDATA[";
     // 		print htmlspecialchars($asset->getDisplayName(), ENT_COMPAT, 'UTF-8');
     print "]]></title>\n";
     // Caption
     print "\t\t<caption><![CDATA[";
     // 		$this->printAsset($asset);
     print "]]></caption>\n";
     // Text-Position
     print "\t\t<text-position>";
     print "none";
     print "</text-position>\n";
     $fileRecords = $asset->getRecordsByRecordStructure($idManager->getId("FILE"));
     /*********************************************************
      * Files
      *********************************************************/
     while ($fileRecords->hasNext()) {
         $fileRecord = $fileRecords->next();
         $fileRecordId = $fileRecord->getId();
         if ($fileRecordId->isEqual($recordId)) {
             $this->printFileRecord($fileRecord, $repositoryId, $assetId);
         }
     }
     print "\t</slide>\n";
 }
开发者ID:adamfranco,项目名称:concerto,代码行数:43,代码来源:browserecordxml.act.php


注:本文中的Asset::getRepository方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。