Class Version

Namespace: Concrete\Core\File
Entity
Table(name="fileversions")
Located at src/File/Version.php

Methods summary

public static
# add( Concrete\Core\File\File $file, $filename, $prefix, $data = array() )
public static
# cleanTags( $tagsStr )
public
public
public
public
# getTags( )
public
# setAttribute( $ak, $value )
public File
# getFile( )

returns the File object associated with this FileVersion object

public
public
# clearAttribute( $ak )
public
# getAttributeValueObject( $ak, $createIfNotFound = false )
public
public
public
# delete( $deleteFilesAndThumbnails = false )

Removes a version of a file. Note, does NOT remove the file because we don't know where the file might elsewhere be used/referenced.

public
# deleteThumbnail( $type )

Deletes the thumbnail for the particular thumbnail type.

public Concrete\Flysystem\File
# getFileResource( )

Returns an abstracted File object for the resource. NOT a concrete5 file object.

public
public
# getSize( )
public
public
public
public string
# getDateAdded( )

Gets the date a file version was added

public
public
# duplicate( )

Takes the current value of the file version and makes a new one with the same values

public
# deny( )
protected
# save( $flush = true )
public
# getType( )
public
public
# getVersionLogComments( )

Returns an array containing human-readable descriptions of everything that happened in this version

public
# updateTitle( $title )
public
# logVersionUpdate( $updateTypeID, $updateTypeAttributeID = 0 )
public
# updateTags( $tags )
public
# updateDescription( $descr )
public
# rename( $filename )
public
# updateContents( $contents )
public
# updateFile( $filename, $prefix )
public
# approve( )
public
# getFileContents( )

Return the contents of a file

public
# getForceDownloadURL( )

Returns a url that can be used to download a file, will force the download of all file types, even if your browser can display them.

public
# forceDownload( )

Forces the download of a file.

public
public
public
public
# getAttribute( $ak, $mode = false )

Gets an attribute for the file. If "nice mode" is set, we display it nicely for use in the file attributes table

public
public mixed
# hasThumbnail( $level )
public
public
# getThumbnailURL( $type )
public
# importThumbnail( Concrete\Core\File\Image\Thumbnail\Type\Version $version, $path )

When given a thumbnail type versin object and a full path to a file on the server the file is imported into the system as is as the thumbnail.

public
# getURL( )

Returns a full URL to the file on disk

public
# getDownloadURL( )

Returns a URL that can be used to download the file. This passes through the download_file single page.

public
# refreshAttributes( $rescanThumbnails = true )

Responsible for taking a particular version of a file and rescanning all its attributes This will run any type-based import routines, and store those attributes, generate thumbnails, etc...

public
# getTitle( )
public
# getJSONObject( )

Return a representation of the current FileVersion object as something easily serializable.

public
# canView( )

Checks current viewers for this type and returns true if there is a viewer for this type, false if not

public
# canEdit( )
public
public
public

Constants summary

integer UT_REPLACE_FILE
# 1
integer UT_TITLE
# 2
integer UT_DESCRIPTION
# 3
integer UT_TAGS
# 4
integer UT_EXTENDED_ATTRIBUTE
# 5
integer UT_CONTENTS
# 6
integer UT_RENAME
# 7

Properties summary

protected Concrete\Core\File\File $file

/* @Id

#
protected integer $fvID
# 0
protected $fvFilename
# null
protected $fvPrefix
#
protected $fvDateAdded
#
protected $fvActivateDateTime
#
protected boolean $fvIsApproved
# false
protected integer $fvAuthorUID
# 0
protected integer $fvSize
# 0
protected integer $fvApproverUID
# 0
protected $fvTitle
# null
protected $fvDescription
# null
protected $fvExtension
# null
protected integer $fvType
# 0
protected $fvTags
# null
protected boolean $fvHasListingThumbnail
# false
protected boolean $fvHasDetailThumbnail
# false
protected array $attributes
# array()