Neos\Media\Domain\Model\Asset::refresh PHP Method

refresh() public method

Refreshes this asset after the Resource or any other parameters affecting thumbnails have been modified
public refresh ( ) : void
return void
    public function refresh()
    {
        $assetClassType = str_replace('Neos\\Media\\Domain\\Model\\', '', get_class($this));
        $this->systemLogger->log(sprintf('%s: refresh() called, clearing all thumbnails. Filename: %s. PersistentResource SHA1: %s', $assetClassType, $this->getResource()->getFilename(), $this->getResource()->getSha1()), LOG_DEBUG);
        // whitelist objects so they can be deleted (even during safe requests)
        $this->persistenceManager->whitelistObject($this);
        foreach ($this->thumbnails as $thumbnail) {
            $this->persistenceManager->whitelistObject($thumbnail);
        }
        $this->thumbnails->clear();
    }

Usage Example

 /**
  * Calculates image width and height from the image resource.
  *
  * @throws ImageFileException
  * @return void
  */
 public function refresh()
 {
     $this->calculateDimensionsFromResource($this->resource);
     parent::refresh();
 }
All Usage Examples Of Neos\Media\Domain\Model\Asset::refresh