- Class name: ImageCore
- Parent class: ObjectModel
- Source: classes/Image.php line 27
- $_cacheGetSize
- $access_rights
- $cover
- $definition
- $existing_path
- $folder
- $id
- $id_image
- $id_product
- $image_format
- $legend
- $position
- $source_index
- $db
- $def
- $fieldsRequired
- $fieldsRequiredDatabase
- $fieldsRequiredLang
- $fieldsSize
- $fieldsSizeLang
- $fieldsValidate
- $fieldsValidateLang
- $force_id
- $get_shop_from_context
- $id_lang
- $id_shop
- $id_shop_list
- $identifier
- $image_dir
- $table
- $tables
- $update_fields
- $webserviceParameters
- __construct
- add
- addFieldsRequiredDatabase
- associateTo
- cacheFieldsRequiredDatabase
- clearCache
- clearTmpDir
- createImgFolder
- delete
- deleteAllImages
- deleteCover
- deleteImage
- deleteProductAttributeImage
- deleteSelection
- displayFieldName
- duplicateAttributeImageAssociations
- duplicateObject
- duplicateProductImages
- duplicateShops
- existsInDatabase
- formatFields
- formatValue
- getAllImages
- getAssociatedShops
- getCover
- getDefinition
- getExistingImgPath
- getFieldByLang
- getFields
- getFieldsLang
- getFieldsRequiredDatabase
- getFieldsShop
- getHeight
- getHighestPosition
- getImages
- getImagesTotal
- getImgFolder
- getImgFolderStatic
- getImgPath
- getPathForCreation
- getSize
- getTranslationsFields
- getValidationRules
- getWebserviceObjectList
- getWebserviceParameters
- getWidth
- hasMultishopEntries
- hydrate
- hydrateCollection
- isAssociatedToShop
- isCurrentlyUsed
- isLangMultishop
- isMultiShopField
- isMultishop
- makeTranslationFields
- moveToNewFileSystem
- positionImage
- replaceAttributeImageAssociationId
- save
- setDefinitionRetrocompatibility
- setFieldsToUpdate
- testFileSystem
- toggleStatus
- update
- updateMultishopTable
- updatePosition
- validateControler
- validateController
- validateField
- validateFields
- validateFieldsLang
- validateFieldsRequiredDatabase
protected mixed $_cacheGetSize = array()
- Visibility: protected
- This property is static.
- Source: classes/Image.php line 76.
protected integer $access_rights = 509
- Visibility: protected
- This property is static.
- Source: classes/Image.php line 59.
public boolean $cover
- Visibility: public
- Source: classes/Image.php line 41.
public mixed $definition = array('table' => 'image', 'primary' => 'id_image', 'multilang' => true, 'fields' => array('id_product' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'position' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'), 'cover' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'shop' => true), 'legend' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 128)))
- Visibility: public
- This property is static.
- Source: classes/Image.php line 64.
protected string $existing_path
- Visibility: protected
- Source: classes/Image.php line 56.
protected string $folder
- Visibility: protected
- Source: classes/Image.php line 53.
public mixed $id
- Visibility: public
- Source: classes/Image.php line 29.
public integer $id_image
- Visibility: public
- Source: classes/Image.php line 32.
public integer $id_product
- Visibility: public
- Source: classes/Image.php line 35.
public string $image_format = 'jpg'
- Visibility: public
- Source: classes/Image.php line 47.
public string $legend
- Visibility: public
- Source: classes/Image.php line 44.
public integer $position
- Visibility: public
- Source: classes/Image.php line 38.
public string $source_index
- Visibility: public
- Source: classes/Image.php line 50.
protected \Db $db = false
- Visibility: protected
- This property is static.
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 140.
protected array $def
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 130.
protected mixed $fieldsRequired = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 80.
protected mixed $fieldsRequiredDatabase = null
- Visibility: protected
- This property is static.
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 65.
protected mixed $fieldsRequiredLang = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 95.
protected mixed $fieldsSize = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 85.
protected mixed $fieldsSizeLang = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 100.
protected mixed $fieldsValidate = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 90.
protected mixed $fieldsValidateLang = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 105.
public \boolean, $force_id = false
- Visibility: public
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 145.
protected mixed $get_shop_from_context = true
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 63.
protected integer $id_lang = null
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 57.
protected mixed $id_shop = null
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 59.
public mixed $id_shop_list = null
- Visibility: public
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 61.
protected mixed $identifier
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 75.
protected string $image_dir = null
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 116.
protected mixed $table
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 70.
protected mixed $tables = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 110.
protected array $update_fields = null
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 135.
protected array $webserviceParameters = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 113.
mixed ImageCore::__construct($id, $id_lang)
- Visibility: public
- Source: classes/Image.php line 78
- $id mixed
- $id_lang mixed
mixed ImageCore::add($autodate, $null_values)
- Visibility: public
- Source: classes/Image.php line 85
- $autodate mixed
- $null_values mixed
mixed ObjectModelCore::addFieldsRequiredDatabase($fields)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1218
- $fields mixed
boolean ObjectModelCore::associateTo(integer|array $id_shops)
This function associate an item to its context
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1270
- $id_shops integer|array
mixed ObjectModelCore::cacheFieldsRequiredDatabase()
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1205
mixed ObjectModelCore::clearCache($all)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1232
- $all mixed
mixed ImageCore::clearTmpDir()
Clear all images in tmp dir
- Visibility: public
- This method is static.
- Source: classes/Image.php line 396
boolean ImageCore::createImgFolder()
Create parent folders for the image in the new filesystem
- Visibility: public
- Source: classes/Image.php line 549
mixed ImageCore::delete()
- Visibility: public
- Source: classes/Image.php line 93
boolean ImageCore::deleteAllImages(string $path, string $format)
Recursively deletes all product images in the given folder tree and removes empty folders.
- Visibility: public
- This method is static.
- Source: classes/Image.php line 472
- $path string - folder containing the product images to delete
- $format string - image format
boolean ImageCore::deleteCover(integer $id_product)
Delete product cover
- Visibility: public
- This method is static.
- Source: classes/Image.php line 194
- $id_product integer - Product ID
mixed ImageCore::deleteImage($force_delete)
Delete the product image from disk and remove the containing folder if empty Handles both legacy and new image filesystems
- Visibility: public
- Source: classes/Image.php line 418
- $force_delete mixed
mixed ImageCore::deleteProductAttributeImage()
Delete Image - Product attribute associations for this image
- Visibility: public
- Source: classes/Image.php line 405
boolean ObjectModelCore::deleteSelection(array $selection)
Delete several objects from database
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 743
- $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 988
- $field mixed
- $class mixed
- $htmlentities mixed
- $context Context
boolean ImageCore::duplicateAttributeImageAssociations($combination_images)
Duplicate product attribute image associations
- Visibility: public
- This method is static.
- Source: classes/Image.php line 293
- $combination_images mixed
\new ObjectModelCore::duplicateObject()
Duplicate current object to database
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 527
mixed ImageCore::duplicateProductImages(integer $id_product_old, boolean $id_product_new, $combination_images)
Copy images from a product to another
- Visibility: public
- This method is static.
- Source: classes/Image.php line 235
- $id_product_old integer - Source product ID
- $id_product_new boolean - Destination product ID
- $combination_images mixed
mixed ObjectModelCore::duplicateShops($id)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1314
- $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 1438
- $id_entity integer
- $table string
array ObjectModelCore::formatFields(integer $type, integer $id_lang)
- Visibility: protected
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 330
- $type integer - FORMAT_COMMON or FORMAT_LANG or FORMAT_SHOP
- $id_lang integer - If this parameter is given, only take lang fields
mixed ObjectModelCore::formatValue(mixed $value, integer $type, $with_quotes, $purify)
Format a data
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 377
- $value mixed
- $type integer
- $with_quotes mixed
- $purify mixed
array ImageCore::getAllImages()
Return Images
- Visibility: public
- This method is static.
- Source: classes/Image.php line 150
array ObjectModelCore::getAssociatedShops()
Get the list of associated id_shop
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1299
boolean ImageCore::getCover(integer $id_product)
Get product cover
- Visibility: public
- This method is static.
- Source: classes/Image.php line 220
- $id_product integer - Product ID
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 1544
- $class string - Name of object
- $field string - Name of field if we want the definition of one field only
mixed ImageCore::getExistingImgPath()
Returns image path in the old or in the new filesystem
@ returns string image path
- Visibility: public
- Source: classes/Image.php line 512
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 1651
- $field_name mixed
- $id_lang null
array ObjectModelCore::getFields()
Prepare fields for ObjectModel class (add, update) All fields are verified (pSQL, intval.
..)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 258
array ObjectModelCore::getFieldsLang()
Prepare multilang fields
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 295
mixed ObjectModelCore::getFieldsRequiredDatabase($all)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1197
- $all mixed
array ObjectModelCore::getFieldsShop()
Prepare fields for multishop Fields are not validated here, we considere they are already validated in getFields() method, this not the best solution but this is the only one possible for retro compatibility.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 281
mixed ImageCore::getHeight($params, $smarty)
- Visibility: public
- This method is static.
- Source: classes/Image.php line 387
- $params mixed
- $smarty mixed
integer ImageCore::getHighestPosition(integer $id_product)
Return highest position of images for a product
- Visibility: public
- This method is static.
- Source: classes/Image.php line 179
- $id_product integer - Product ID
array ImageCore::getImages(integer $id_lang, integer $id_product, integer $id_product_attribute)
Return available images for a product
- Visibility: public
- This method is static.
- Source: classes/Image.php line 130
- $id_lang integer - Language ID
- $id_product integer - Product ID
- $id_product_attribute integer - Product Attribute ID
integer ImageCore::getImagesTotal(integer $id_product)
Return number of images for a product
- Visibility: public
- This method is static.
- Source: classes/Image.php line 164
- $id_product integer - Product ID
string ImageCore::getImgFolder()
Returns the path to the folder containing the image in the new filesystem
- Visibility: public
- Source: classes/Image.php line 533
string ImageCore::getImgFolderStatic(mixed $id_image)
Returns the path to the folder containing the image in the new filesystem
- Visibility: public
- This method is static.
- Source: classes/Image.php line 589
- $id_image mixed
string ImageCore::getImgPath()
Returns the path to the image without file extension
- Visibility: public
- Source: classes/Image.php line 574
string ImageCore::getPathForCreation()
Returns the path where a product image should be created (without file format)
- Visibility: public
- Source: classes/Image.php line 687
mixed ImageCore::getSize($type)
- Visibility: public
- This method is static.
- Source: classes/Image.php line 370
- $type mixed
mixed ObjectModelCore::getTranslationsFields($fields_array)
- Visibility: protected
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 778
- $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 153
- $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 1138
- $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 1060
- $ws_params_attribute_name mixed
mixed ImageCore::getWidth($params, $smarty)
- Visibility: public
- This method is static.
- Source: classes/Image.php line 381
- $params mixed
- $smarty mixed
boolean ObjectModelCore::hasMultishopEntries()
Check if there is more than one entries in associated shop table for current entity
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1339
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 1476
- $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 1495
- $class string - Class of objects to hydrate
- $datas array - List of data (multi-dimensional array)
- $id_lang 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 1247
- $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 1456
- $table string - name of table linked to entity
- $has_active_column boolean - true if the table has an active column
mixed ObjectModelCore::isLangMultishop()
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1356
mixed ObjectModelCore::isMultiShopField($field)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1351
- $field mixed
mixed ObjectModelCore::isMultishop()
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1346
mixed ObjectModelCore::makeTranslationFields($fields, $fields_array, $id_language)
- Visibility: protected
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 794
- $fields mixed
- $fields_array mixed
- $id_language mixed
mixed ImageCore::moveToNewFileSystem($max_execution_time)
Move all legacy product image files from the image folder root to their subfolder in the new filesystem.
If max_execution_time is provided, stops before timeout and returns string "timeout". If any image cannot be moved, stops and returns "false"
- Visibility: public
- This method is static.
- Source: classes/Image.php line 605
- $max_execution_time mixed
mixed ImageCore::positionImage(integer $position, boolean $direction)
Reposition image
- Visibility: public
- Source: classes/Image.php line 312
- $position integer - Position
- $direction boolean - Direction
mixed ImageCore::replaceAttributeImageAssociationId($combination_images, $saved_id, $id_image)
- Visibility: protected
- This method is static.
- Source: classes/Image.php line 278
- $combination_images mixed
- $saved_id mixed
- $id_image 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 423
- $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 1582
mixed ObjectModelCore::setFieldsToUpdate(array $fields)
Set a list of specific fields to update array(field1 => true, field2 => false, langfield1 => array(1 => true, 2 => false))
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1677
- $fields array
boolean ImageCore::testFileSystem()
Try to create and delete some folders to check if moving images to new file system will be possible
- Visibility: public
- This method is static.
- Source: classes/Image.php line 655
boolean ObjectModelCore::toggleStatus()
Toggle object status in database
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 759
boolean ObjectModelCore::update(boolean $null_values)
Update current object to database
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 583
- $null_values boolean
boolean ObjectModelCore::updateMultishopTable(string $classname, array $data, string $where, string $specific_where)
Update a table and splits the common datas and the shop datas
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1371
- $classname string
- $data array
- $where string
- $specific_where string - Only executed for common table
integer ImageCore::updatePosition(integer $way, integer $position)
Change an image position and update relative positions
- Visibility: public
- Source: classes/Image.php line 347
- $way integer - position is moved up if 0, moved down if 1
- $position integer - new position of the moved image
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 1006
- $htmlentities mixed
mixed ObjectModelCore::validateController($htmlentities)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1012
- $htmlentities mixed
boolean|string ObjectModelCore::validateField(string $field, mixed $value, integer $id_lang, $skip, $human_errors)
Validate a single field
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 905
- $field string - Field name
- $value mixed - Field value
- $id_lang integer
- $skip mixed
- $human_errors mixed
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 832
- $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 861
- $die boolean
- $error_return boolean
mixed ObjectModelCore::validateFieldsRequiredDatabase($htmlentities)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1174
- $htmlentities mixed