- Class name: ProductDownloadCore
- Parent class: ObjectModel
- Source: classes/ProductDownload.php line 28
- $_productIds
- $active
- $date_add
- $date_expiration
- $definition
- $display_filename
- $filename
- $id_product
- $id_product_attribute
- $is_shareable
- $nb_days_accessible
- $nb_downloadable
- $def
- $fieldsRequired
- $fieldsRequiredDatabase
- $fieldsRequiredLang
- $fieldsSize
- $fieldsSizeLang
- $fieldsValidate
- $fieldsValidateLang
- $id
- $id_lang
- $id_shop
- $identifier
- $image_dir
- $image_format
- $table
- $tables
- $webserviceParameters
- __construct
- add
- addFieldsRequiredDatabase
- associateTo
- checkFile
- checkWritableDir
- clearCache
- delete
- deleteFile
- deleteImage
- deleteSelection
- displayFieldName
- duplicateShops
- existsInDatabase
- formatFields
- formatValue
- getAttributeFromIdAttribute
- getAttributeFromIdProduct
- getDeadline
- getDefinition
- getFieldByLang
- getFields
- getFieldsLang
- getFieldsRequiredDatabase
- getFilenameFromFilename
- getFilenameFromIdAttribute
- getFilenameFromIdProduct
- getHash
- getHtmlLink
- getIdFromFilename
- getIdFromIdAttribute
- getIdFromIdProduct
- getNewFilename
- getTextLink
- getTranslationsFields
- getValidationRules
- getWebserviceObjectList
- getWebserviceParameters
- hydrate
- hydrateCollection
- isAssociatedToGroupShop
- isAssociatedToShop
- isCurrentlyUsed
- isFeatureActive
- isLangMultishop
- makeTranslationFields
- save
- setDefinitionRetrocompatibility
- toggleStatus
- update
- validateControler
- validateController
- validateField
- validateFields
- validateFieldsLang
protected mixed $_productIds = array()
- Visibility: protected
- This property is static.
- Source: classes/ProductDownload.php line 60.
public boolean $active = 1
- Visibility: public
- Source: classes/ProductDownload.php line 55.
public string $date_add
- Visibility: public
- Source: classes/ProductDownload.php line 43.
public string $date_expiration
- Visibility: public
- Source: classes/ProductDownload.php line 46.
public mixed $definition = array('table' => 'product_download', 'primary' => 'id_product_download', 'fields' => array('id_product' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'id_product_attribute' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'display_filename' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 255), 'filename' => array('type' => self::TYPE_STRING, 'validate' => 'isSha1', 'size' => 255), 'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'), 'date_expiration' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'), 'nb_days_accessible' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'size' => 10), 'nb_downloadable' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'size' => 10), 'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'is_shareable' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool')))
- Visibility: public
- This property is static.
- Source: classes/ProductDownload.php line 65.
public string $display_filename
- Visibility: public
- Source: classes/ProductDownload.php line 37.
public string $filename
- Visibility: public
- Source: classes/ProductDownload.php line 40.
public integer $id_product
- Visibility: public
- Source: classes/ProductDownload.php line 31.
public integer $id_product_attribute
- Visibility: public
- Source: classes/ProductDownload.php line 34.
public boolean $is_shareable
- Visibility: public
- Source: classes/ProductDownload.php line 58.
public string $nb_days_accessible
- Visibility: public
- Source: classes/ProductDownload.php line 49.
public string $nb_downloadable
- Visibility: public
- Source: classes/ProductDownload.php line 52.
protected array $def
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 122.
protected mixed $fieldsRequired = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 72.
protected mixed $fieldsRequiredDatabase = null
- Visibility: protected
- This property is static.
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 57.
protected mixed $fieldsRequiredLang = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 87.
protected mixed $fieldsSize = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 77.
protected mixed $fieldsSizeLang = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 92.
protected mixed $fieldsValidate = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 82.
protected mixed $fieldsValidateLang = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 97.
public integer $id
- Visibility: public
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 48.
protected integer $id_lang = null
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 51.
protected mixed $id_shop = null
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 53.
protected mixed $identifier
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 67.
protected string $image_dir = null
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 108.
protected string $image_format = 'jpg'
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 111.
protected mixed $table
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 62.
protected mixed $tables = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 102.
protected array $webserviceParameters = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 105.
mixed ProductDownloadCore::__construct(integer $id_product_download)
Build a virtual product
- Visibility: public
- Source: classes/ProductDownload.php line 87
- $id_product_download integer - Existing productDownload id in order to load object (optional)
mixed ProductDownloadCore::add($autodate, $null_values)
- Visibility: public
- Source: classes/ProductDownload.php line 106
- $autodate mixed
- $null_values mixed
mixed ObjectModelCore::addFieldsRequiredDatabase($fields)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 925
- $fields mixed
boolean ObjectModelCore::associateTo(integer|array $id_shops, string $type)
This function associate an item to its context
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 973
- $id_shops integer|array
- $type string
boolean ProductDownloadCore::checkFile()
Check if file exists
- Visibility: public
- Source: classes/ProductDownload.php line 156
boolean ProductDownloadCore::checkWritableDir()
Check if download repository is writable
- Visibility: public
- This method is static.
- Source: classes/ProductDownload.php line 167
mixed ObjectModelCore::clearCache($all)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 939
- $all mixed
mixed ProductDownloadCore::delete($delete)
- Visibility: public
- Source: classes/ProductDownload.php line 129
- $delete mixed
boolean ProductDownloadCore::deleteFile(integer $id_product_download)
Delete the file
- Visibility: public
- Source: classes/ProductDownload.php line 142
- $id_product_download integer - : if we need to delete a specific product attribute file
boolean ObjectModelCore::deleteImage()
Delete images associated with the object
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1047
boolean ObjectModelCore::deleteSelection(array $selection)
Delete several objects from database
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 559
- $selection array
mixed ObjectModelCore::displayFieldName($field, $class, $htmlentities, \Context $context)
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 757
- $field mixed
- $class mixed
- $htmlentities mixed
- $context Context
mixed ObjectModelCore::duplicateShops($id)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1017
- $id mixed
boolean ObjectModelCore::existsInDatabase(integer $id_entity, string $table)
Specify if an ObjectModel is already in database
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1081
- $id_entity integer
- $table string
array ObjectModelCore::formatFields(integer $id_lang)
- Visibility: protected
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 272
- $id_lang integer - If this parameter is given, only take lang fields
mixed ObjectModelCore::formatValue(mixed $value, integer $type, $with_quotes)
Format a data
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 319
- $value mixed
- $type integer
- $with_quotes mixed
array ProductDownloadCore::getAttributeFromIdAttribute(integer $id_product, integer $id_product_attribute)
Return the result from an id_product_attribute
- Visibility: public
- This method is static.
- Source: classes/ProductDownload.php line 242
- $id_product integer - Product the id
- $id_product_attribute integer - Attribute the id
integer ProductDownloadCore::getAttributeFromIdProduct($id_product)
Return the display filename from a physical filename
- Visibility: public
- This method is static.
- Source: classes/ProductDownload.php line 227
- $id_product mixed
string ProductDownloadCore::getDeadline()
Return a deadline
- Visibility: public
- Source: classes/ProductDownload.php line 356
array ObjectModelCore::getDefinition(string $class, string $field)
Get object definition
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1184
- $class string - Name of object
- $field string - Name of field if we want the definition of one field only
mixed ObjectModelCore::getFieldByLang($field_name, null $id_lang)
Return the field value for the specified language if the field is multilang, else the field value.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1261
- $field_name mixed
- $id_lang null
array ProductDownloadCore::getFields()
- Visibility: public
- Source: classes/ProductDownload.php line 97
array ObjectModelCore::getFieldsLang()
Prepare multilang fields
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 249
mixed ObjectModelCore::getFieldsRequiredDatabase($all)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 917
- $all mixed
string ProductDownloadCore::getFilenameFromFilename(string $filename)
Return the display filename from a physical filename
- Visibility: public
- This method is static.
- Source: classes/ProductDownload.php line 309
- $filename string - Filename physically
string ProductDownloadCore::getFilenameFromIdAttribute(integer $id_product, integer $id_product_attribute)
Return the filename from an id_product_attribute
- Visibility: public
- This method is static.
- Source: classes/ProductDownload.php line 292
- $id_product integer - Product the id
- $id_product_attribute integer - Attribute the id
string ProductDownloadCore::getFilenameFromIdProduct(integer $id_product)
Return the filename from an id_product
- Visibility: public
- This method is static.
- Source: classes/ProductDownload.php line 275
- $id_product integer - Product the id
string ProductDownloadCore::getHash()
Return a hash for control download access
- Visibility: public
- Source: classes/ProductDownload.php line 369
string ProductDownloadCore::getHtmlLink(string $class, boolean $admin, boolean $hash)
Return html link
- Visibility: public
- Source: classes/ProductDownload.php line 341
- $class string - CSS selector
- $admin boolean - specific to backend
- $hash boolean - hash code in table order detail
integer ProductDownloadCore::getIdFromFilename(string $filename)
Return the display filename from a physical filename
- Visibility: public
- This method is static.
- Source: classes/ProductDownload.php line 261
- $filename string - Filename physically
integer ProductDownloadCore::getIdFromIdAttribute(integer $id_product, $id_product_attribute)
Return the id_product_download from an id_product
- Visibility: public
- This method is static.
- Source: classes/ProductDownload.php line 200
- $id_product integer - Product the id
- $id_product_attribute mixed
integer ProductDownloadCore::getIdFromIdProduct(integer $id_product)
Return the id_product_download from an id_product
- Visibility: public
- This method is static.
- Source: classes/ProductDownload.php line 178
- $id_product integer - Product the id
string ProductDownloadCore::getNewFilename()
Return a sha1 filename
- Visibility: public
- This method is static.
- Source: classes/ProductDownload.php line 380
string ProductDownloadCore::getTextLink(boolean $admin, string $hash)
Return html link
- Visibility: public
- Source: classes/ProductDownload.php line 325
- $admin boolean - specific to backend (optionnal)
- $hash string - hash code in table order detail (optionnal)
mixed ObjectModelCore::getTranslationsFields($fields_array)
- Visibility: protected
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 595
- $fields_array mixed
array ObjectModelCore::getValidationRules(string $class)
Returns object validation rules (fields validity)
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 130
- $class string - Child class name for static use (optional)
mixed ObjectModelCore::getWebserviceObjectList($sql_join, $sql_filter, $sql_sort, $sql_limit)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 890
- $sql_join mixed
- $sql_filter mixed
- $sql_sort mixed
- $sql_limit mixed
mixed ObjectModelCore::getWebserviceParameters($ws_params_attribute_name)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 816
- $ws_params_attribute_name mixed
mixed ObjectModelCore::hydrate(array $data, integer $id_lang)
Fill an object with given data. Data must be an array with this syntax: array(objProperty => value, objProperty2 => value, etc.)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1116
- $data array
- $id_lang integer
array ObjectModelCore::hydrateCollection(string $class, array $datas, integer $id_lang)
Fill (hydrate) a list of objects in order to get a collection of these objects
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1135
- $class string - Class of objects to hydrate
- $datas array - List of data (multi-dimensional array)
- $id_lang integer
boolean ObjectModelCore::isAssociatedToGroupShop(integer $id_group_shop)
Check if current object is associated to a group shop
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1003
- $id_group_shop integer
boolean ObjectModelCore::isAssociatedToShop(integer $id_shop)
Check if current object is associated to a shop
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 954
- $id_shop integer
boolean ObjectModelCore::isCurrentlyUsed(string $table, boolean $has_active_column)
This method is allow to know if a entity is currently used
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1099
- $table string - name of table linked to entity
- $has_active_column boolean - true if the table has an active column
boolean ProductDownloadCore::isFeatureActive()
This method is allow to know if a feature is used or active
- Visibility: public
- This method is static.
- Source: classes/ProductDownload.php line 393
mixed ObjectModelCore::isLangMultishop()
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1037
mixed ObjectModelCore::makeTranslationFields($fields, $fields_array, $id_language)
- Visibility: protected
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 611
- $fields mixed
- $fields_array mixed
- $id_language mixed
boolean ObjectModelCore::save(boolean $null_values, boolean $autodate)
Save current object to database (add or update)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 360
- $null_values boolean
- $autodate boolean
mixed ObjectModelCore::setDefinitionRetrocompatibility()
Retrocompatibility for classes without $definition static Remove this in 1.6 !
- Visibility: protected
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1207
boolean ObjectModelCore::toggleStatus()
Toggle object status in database
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 575
mixed ProductDownloadCore::update($null_values)
- Visibility: public
- Source: classes/ProductDownload.php line 118
- $null_values mixed
mixed ObjectModelCore::validateControler($htmlentities)
TODO: refactor rename all calls to this to validateController
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 772
- $htmlentities mixed
mixed ObjectModelCore::validateController($htmlentities)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 778
- $htmlentities mixed
boolean|string ObjectModelCore::validateField(string $field, mixed $value, integer $id_lang)
Validate a single field
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 710
- $field string - Field name
- $value mixed - Field value
- $id_lang integer
boolean|string ObjectModelCore::validateFields(boolean $die, boolean $error_return)
Check for fields validity before database interaction
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 649
- $die boolean
- $error_return boolean
boolean|string ObjectModelCore::validateFieldsLang(boolean $die, boolean $error_return)
Check for multilingual fields validity before database interaction
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 675
- $die boolean
- $error_return boolean