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


PHP PersistenceManagerInterface::whiteListObject方法代码示例

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


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

示例1: getThumbnail

 /**
  * Returns a thumbnail of the given asset
  *
  * If the maximum width / height is not specified or exceeds the original asset's dimensions, the width / height of
  * the original asset is used.
  *
  * @param AssetInterface $asset The asset to render a thumbnail for
  * @param ThumbnailConfiguration $configuration
  * @return Thumbnail
  * @throws \Exception
  */
 public function getThumbnail(AssetInterface $asset, ThumbnailConfiguration $configuration)
 {
     $thumbnail = $this->thumbnailRepository->findOneByAssetAndThumbnailConfiguration($asset, $configuration);
     if ($thumbnail === null) {
         if (!$asset instanceof ImageInterface) {
             throw new NoThumbnailAvailableException(sprintf('ThumbnailService could not generate a thumbnail for asset of type "%s" because currently only Image assets are supported.', get_class($asset)), 1381493670);
         }
         $thumbnail = new Thumbnail($asset, $configuration);
         $this->thumbnailRepository->add($thumbnail);
         $asset->addThumbnail($thumbnail);
         // Allow thumbnails to be persisted even if this is a "safe" HTTP request:
         $this->persistenceManager->whiteListObject($thumbnail);
         $this->persistenceManager->whiteListObject($thumbnail->getResource());
     }
     return $thumbnail;
 }
开发者ID:hlubek,项目名称:neos-development-collection,代码行数:27,代码来源:ThumbnailService.php

示例2: refreshThumbnail

 /**
  * Refreshes a thumbnail and persists the thumbnail
  *
  * @param Thumbnail $thumbnail
  * @return void
  */
 public function refreshThumbnail(Thumbnail $thumbnail)
 {
     $thumbnail->refresh();
     $this->persistenceManager->whiteListObject($thumbnail);
     if (!$this->persistenceManager->isNewObject($thumbnail)) {
         $this->thumbnailRepository->update($thumbnail);
     }
 }
开发者ID:robertlemke,项目名称:neos-development-collection,代码行数:14,代码来源:ThumbnailService.php

示例3: getThumbnail

 /**
  * Returns a thumbnail of the given asset
  *
  * If the maximum width / height is not specified or exceeds the original asset's dimensions, the width / height of
  * the original asset is used.
  *
  * @param AssetInterface $asset The asset to render a thumbnail for
  * @param integer $maximumWidth The thumbnail's maximum width in pixels
  * @param integer $maximumHeight The thumbnail's maximum height in pixels
  * @param string $ratioMode Whether the resulting image should be cropped if both edge's sizes are supplied that would hurt the aspect ratio
  * @param boolean $allowUpScaling Whether the resulting image should be upscaled
  * @return Thumbnail
  * @throws \Exception
  */
 public function getThumbnail(AssetInterface $asset, $maximumWidth = NULL, $maximumHeight = NULL, $ratioMode = ImageInterface::RATIOMODE_INSET, $allowUpScaling = NULL)
 {
     $thumbnail = $this->thumbnailRepository->findOneByAssetAndDimensions($asset, $ratioMode, $maximumWidth, $maximumHeight, $allowUpScaling);
     if ($thumbnail === NULL) {
         if (!$asset instanceof ImageInterface) {
             throw new NoThumbnailAvailableException(sprintf('ThumbnailService could not generate a thumbnail for asset of type "%s" because currently only Image assets are supported.', get_class($asset)), 1381493670);
         }
         $thumbnail = new Thumbnail($asset, $maximumWidth, $maximumHeight, $ratioMode, $allowUpScaling);
         $this->thumbnailRepository->add($thumbnail);
         $asset->addThumbnail($thumbnail);
         // Allow thumbnails to be persisted even if this is a "safe" HTTP request:
         $this->persistenceManager->whiteListObject($thumbnail);
         $this->persistenceManager->whiteListObject($thumbnail->getResource());
     }
     return $thumbnail;
 }
开发者ID:netlogix,项目名称:media,代码行数:30,代码来源:ThumbnailService.php


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