public function addFromFile($filePath, $tag = null)
    {
        if (is_null($filePath))
            return;

        $this->getMediaAdder()
             ->performedOn($this->attachment)
             ->useMediaTag($tag)
             ->fromFile(new SymfonyFile($filePath));

        return $this;
    }
public function addFromFile($filePath, $tag = null)
    {
        if (is_null($filePath))
            return;

        $this->getMediaAdder()
             ->performedOn($this->attachment)
             ->useMediaTag($tag)
             ->fromFile(new SymfonyFile($filePath));

        return $this;
    }
public function addFromFile ( $ filePath , $ tag = null ) { if ( is_null ( $ filePath ) ) return ; $ this -> getMediaAdder ( ) -> performedOn ( $ this -> attachment ) -> useMediaTag ( $ tag ) -> fromFile ( new SymfonyFile ( $ filePath ) ) ; return $ this ; }
Creates a file object from a file on the disk.
@param $filePath
@param null $tag
@return self|void
Creates a file object from a file on the disk .