Properties

$id_product

$id_product : integer

Type

integer — Product id which download belongs

$display_filename

$display_filename : string

Type

string — DisplayFilename the name which appear

$filename

$filename : string

Type

string — PhysicallyFilename the name of the file on hard disk

$date_add

$date_add : string

Type

string — DateDeposit when the file is upload

$date_expiration

$date_expiration : string

Type

string — DateExpiration deadline of the file

$nb_days_accessible

$nb_days_accessible : string

Type

string — NbDaysAccessible how many days the customer can access to file

$nb_downloadable

$nb_downloadable : string

Type

string — NbDownloadable how many time the customer can download the file

$active

$active : boolean

Type

boolean — Active if file is accessible or not

$is_shareable

$is_shareable : boolean

Type

boolean — is_shareable indicates whether the product can be shared

$definition

$definition : 

Type

$_productIds

$_productIds : 

Type

Methods

__construct()

__construct(integer  $id_product_download = null) 

Build a virtual product

Parameters

integer $id_product_download

Existing productDownload id in order to load object (optional)

getFields()

getFields() : array

Returns

array

add()

add(  $autodate = true,   $null_values = false) 

Parameters

$autodate
$null_values

update()

update(  $null_values = false) 

Parameters

$null_values

delete()

delete(  $delete_file = false) 

Parameters

$delete_file

deleteFile()

deleteFile(integer  $id_product_download = null) : boolean

Delete the file

Parameters

integer $id_product_download

: if we need to delete a specific product attribute file

Returns

boolean

checkFile()

checkFile() : boolean

Check if file exists

Returns

boolean

checkWritableDir()

checkWritableDir() : boolean

Check if download repository is writable

Returns

boolean

getIdFromIdProduct()

getIdFromIdProduct(integer  $id_product) : integer

Return the id_product_download from an id_product

Parameters

integer $id_product

Product the id

Returns

integer —

Product the id for this virtual product

getIdFromFilename()

getIdFromFilename(string  $filename) : integer

Return the display filename from a physical filename

Parameters

string $filename

Filename physically

Returns

integer —

Product the id for this virtual product

getFilenameFromIdProduct()

getFilenameFromIdProduct(integer  $id_product) : string

Return the filename from an id_product

Parameters

integer $id_product

Product the id

Returns

string —

Filename the filename for this virtual product

getFilenameFromFilename()

getFilenameFromFilename(string  $filename) : string

Return the display filename from a physical filename

Parameters

string $filename

Filename physically

Returns

string —

Filename the display filename for this virtual product

getTextLink()

getTextLink(boolean  $admin = true, string  $hash = false) : string

Return html link

Parameters

boolean $admin

specific to backend (optionnal)

string $hash

hash code in table order detail (optionnal)

Returns

string —

Html all the code for print a link to the file

getHtmlLink()

getHtmlLink(string  $class = false, boolean  $admin = true, boolean  $hash = false) : string

Return html link

Parameters

string $class

CSS selector

boolean $admin

specific to backend

boolean $hash

hash code in table order detail

Returns

string —

Html all the code for print a link to the file

getDeadline()

getDeadline() : string

Return a deadline

Returns

string —

Datetime in SQL format

getHash()

getHash() : string

Return a hash for control download access

Returns

string —

Hash ready to insert in database

getNewFilename()

getNewFilename() : string

Return a sha1 filename

Returns

string —

Sha1 unique filename

isFeatureActive()

isFeatureActive() : boolean

This method is allow to know if a feature is used or active

Returns

boolean