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

setResource() public method

Sets the asset resource and (re-)initializes the asset.
public setResource ( PersistentResource $resource ) : void
$resource Neos\Flow\ResourceManagement\PersistentResource
return void
    public function setResource(PersistentResource $resource)
    {
        $this->lastModified = new \DateTime();
        $this->resource = $resource;
        $this->refresh();
    }