Skip to content

Latest commit

 

History

History
1141 lines (587 loc) · 26.8 KB

class.WarehouseProductLocationCore.md

File metadata and controls

1141 lines (587 loc) · 26.8 KB

Class WarehouseProductLocationCore

Contents

Properties

Methods

Properties

$fieldsRequired

protected mixed $fieldsRequired = array('id_product', 'id_product_attribute', 'id_warehouse')

$fieldsSize

protected mixed $fieldsSize = array('location' => 64)

$fieldsValidate

protected mixed $fieldsValidate = array('location' => 'isReference', 'id_product' => 'isUnsignedId', 'id_product_attribute' => 'isUnsignedId', 'id_warehouse' => 'isUnsignedId')

$id_product

public integer $id_product

$id_product_attribute

public integer $id_product_attribute

$id_warehouse

public integer $id_warehouse

$identifier

protected mixed $identifier = 'id_warehouse_product_location'

$location

public string $location

$table

protected mixed $table = 'warehouse_product_location'

$_cache

protected mixed $_cache = array()

$fieldsRequiredDatabase

protected \fieldsRequiredDatabase $fieldsRequiredDatabase = null

$fieldsRequiredLang

protected array $fieldsRequiredLang = array()

$fieldsSizeLang

protected array $fieldsSizeLang = array()

$fieldsValidateLang

protected array $fieldsValidateLang = array()

$id

public integer $id

$id_lang

protected integer $id_lang = null

$id_shop

protected mixed $id_shop = null

$image_dir

protected string $image_dir = null

$image_format

protected string $image_format = 'jpg'

$langMultiShop

protected mixed $langMultiShop = false

$tables

protected array $tables = array()

$webserviceParameters

protected array $webserviceParameters = array()

Methods

__construct

mixed ObjectModelCore::__construct(integer $id, integer $id_lang, $id_shop)

Build object

Arguments

  • $id integer - Existing object id in order to load object (optional)
  • $id_lang integer - Required if object is multilingual (optional)
  • $id_shop mixed

add

mixed ObjectModelCore::add($autodate, $nullValues)

Add current object to database

return boolean Insertion result

Arguments

  • $autodate mixed
  • $nullValues mixed

addFieldsRequiredDatabase

mixed ObjectModelCore::addFieldsRequiredDatabase($fields)

Arguments

  • $fields mixed

associateTo

boolean ObjectModelCore::associateTo(integer|array $id_shops, string $type)

This function associate an item to its context

Arguments

  • $id_shops integer|array
  • $type string

clearCache

mixed ObjectModelCore::clearCache($all)

Arguments

  • $all mixed

delete

mixed ObjectModelCore::delete()

Delete current object from database

return boolean Deletion result

deleteImage

boolean ObjectModelCore::deleteImage()

Delete images associated with the object

deleteSelection

mixed ObjectModelCore::deleteSelection($selection)

Delete several objects from database

return boolean Deletion result

Arguments

  • $selection mixed

displayFieldName

mixed ObjectModelCore::displayFieldName($field, $className, $htmlentities, \Context $context)

Arguments

  • $field mixed
  • $className mixed
  • $htmlentities mixed
  • $context Context

duplicateShops

mixed ObjectModelCore::duplicateShops($id)

Arguments

  • $id mixed

existsInDatabase

boolean ObjectModelCore::existsInDatabase($id_entity, $table)

Specify if an ObjectModel is already in database

Arguments

  • $id_entity mixed - entity id
  • $table mixed

getCollection

array WarehouseProductLocationCore::getCollection(integer $id_product)

For a given product, retrieves its warehouses

Arguments

  • $id_product integer

getFields

mixed WarehouseProductLocationCore::getFields()

getFieldsRequiredDatabase

mixed ObjectModelCore::getFieldsRequiredDatabase($all)

Arguments

  • $all mixed

getFieldsValidateLang

array ObjectModelCore::getFieldsValidateLang()

Get list of fields related to language to validate

getIdByProductAndWarehouse

array WarehouseProductLocationCore::getIdByProductAndWarehouse(integer $id_product, integer $id_product_attribute, $id_warehouse)

For a given product and warehouse, get the WarehouseProductLocation corresponding ID

Arguments

  • $id_product integer
  • $id_product_attribute integer
  • $id_warehouse mixed

getIdentifier

string ObjectModelCore::getIdentifier()

Get object identifier name

getProductLocation

array WarehouseProductLocationCore::getProductLocation(integer $id_product, integer $id_product_attribute, integer $id_warehouse)

For a given product and warehouse, get the location

Arguments

  • $id_product integer
  • $id_product_attribute integer
  • $id_warehouse integer

getTranslationsFields

mixed ObjectModelCore::getTranslationsFields(array $fieldsArray)

Prepare multilingual fields for database insertion

Arguments

  • $fieldsArray array - Multilingual fields to prepare return array Prepared fields for database insertion

getValidationRules

array ObjectModelCore::getValidationRules(string $className)

Returns object validation rules (fields validity)

Arguments

  • $className string - Child class name for static use (optional)

getWebserviceObjectList

mixed ObjectModelCore::getWebserviceObjectList($sql_join, $sql_filter, $sql_sort, $sql_limit)

Arguments

  • $sql_join mixed
  • $sql_filter mixed
  • $sql_sort mixed
  • $sql_limit mixed

getWebserviceParameters

mixed ObjectModelCore::getWebserviceParameters($wsParamsAttributeName)

Arguments

  • $wsParamsAttributeName mixed

hydrate

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.)

Arguments

  • $data array
  • $id_lang integer

hydrateCollection

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

Arguments

  • $class string - Class of objects to hydrate
  • $datas array - List of data (multi-dimensional array)
  • $id_lang integer

isAssociatedToGroupShop

boolean ObjectModelCore::isAssociatedToGroupShop(integer $id_group_shop)

Check if current object is associated to a group shop

Arguments

  • $id_group_shop integer

isAssociatedToShop

boolean ObjectModelCore::isAssociatedToShop(integer $id_shop)

Check if current object is associated to a shop

Arguments

  • $id_shop integer

isCurrentlyUsed

boolean ObjectModelCore::isCurrentlyUsed(string $table, boolean $has_active_column)

This method is allow to know if a entity is currently used

Arguments

  • $table string - name of table linked to entity
  • $has_active_column boolean - true if the table has an active column

isLangMultishop

mixed ObjectModelCore::isLangMultishop()

makeTranslationFields

mixed ObjectModelCore::makeTranslationFields($fields, $fieldsArray, $id_language)

Arguments

  • $fields mixed
  • $fieldsArray mixed
  • $id_language mixed

save

mixed ObjectModelCore::save($nullValues, $autodate)

Save current object to database (add or update)

return boolean Insertion result

Arguments

  • $nullValues mixed
  • $autodate mixed

toggleStatus

mixed ObjectModelCore::toggleStatus()

Toggle object status in database

return boolean Update result

update

boolean ObjectModelCore::update($nullValues)

Update current object to database

Arguments

  • $nullValues mixed

validateControler

mixed ObjectModelCore::validateControler($htmlentities)

TODO: refactor rename all calls to this to validateController

Arguments

  • $htmlentities mixed

validateController

mixed ObjectModelCore::validateController($htmlentities)

Arguments

  • $htmlentities mixed

validateFields

mixed ObjectModelCore::validateFields($die, $errorReturn)

Check for fields validity before database interaction

Arguments

  • $die mixed
  • $errorReturn mixed

validateFieldsLang

mixed ObjectModelCore::validateFieldsLang($die, $errorReturn)

Check for multilingual fields validity before database interaction

Arguments

  • $die mixed
  • $errorReturn mixed