Neos\Media\Domain\Service\AssetService::isInUse PHP 메소드

isInUse() 공개 메소드

Returns true if the asset is used.
public isInUse ( Neos\Media\Domain\Model\AssetInterface $asset ) : boolean
$asset Neos\Media\Domain\Model\AssetInterface
리턴 boolean
    public function isInUse(AssetInterface $asset)
    {
        /** @var AssetUsageStrategyInterface $strategy */
        foreach ($this->getUsageStrategies() as $strategy) {
            if ($strategy->isInUse($asset) === true) {
                return true;
            }
        }
        return false;
    }

Usage Example

예제 #1
0
 /**
  * Returns true if the asset is still in use.
  *
  * @return boolean
  * @api
  */
 public function isInUse()
 {
     return $this->assetService->isInUse($this);
 }