public function setFileContent($content)
    {
        $this->getContent();

        if (!is_resource($content)) {
            $stream = fopen('php://memory', 'rwb+');
            fwrite($stream, $content);
            rewind($stream);
        } else {
            $stream = $content;
        }

        $this->content->setData($stream);

        return $this;
    }
public function setFileContent($content)
    {
        $this->getContent();

        if (!is_resource($content)) {
            $stream = fopen('php://memory', 'rwb+');
            fwrite($stream, $content);
            rewind($stream);
        } else {
            $stream = $content;
        }

        $this->content->setData($stream);

        return $this;
    }
public function setFileContent ( $ content ) { $ this -> getContent ( ) ; if ( ! is_resource ( $ content ) ) { $ stream = fopen ( 'php://memory' , 'rwb+' ) ; fwrite ( $ stream , $ content ) ; rewind ( $ stream ) ; } else { $ stream = $ content ; } $ this -> content -> setData ( $ stream ) ; return $ this ; }
Set the content for this file from the given resource or string.

@param resource|string $content the content for the file

@return $this
Set the content for this file from the given resource or string .