Holds Stock
- Class name: WarehouseCore
- Parent class: ObjectModel
- Source: classes/stock/Warehouse.php line 33
- $definition
- $deleted
- $id
- $id_address
- $id_currency
- $id_employee
- $management_type
- $name
- $reference
- $webserviceParameters
- $def
- $fieldsRequired
- $fieldsRequiredDatabase
- $fieldsRequiredLang
- $fieldsSize
- $fieldsSizeLang
- $fieldsValidate
- $fieldsValidateLang
- $id_lang
- $id_shop
- $identifier
- $image_dir
- $image_format
- $table
- $tables
- __construct
- add
- addFieldsRequiredDatabase
- associateTo
- clearCache
- delete
- deleteImage
- deleteSelection
- displayFieldName
- duplicateShops
- exists
- existsInDatabase
- formatFields
- formatValue
- getCarriers
- getDefinition
- getEntity
- getFields
- getFieldsLang
- getFieldsRequiredDatabase
- getNumberOfProducts
- getProductLocation
- getProductWarehouseList
- getQuantitiesOfProducts
- getShops
- getStockValue
- getTranslationsFields
- getValidationRules
- getWarehouseNameById
- getWarehouses
- getWarehousesByEmployee
- getWarehousesByProductId
- getWarehousesGroupedByShops
- getWebserviceObjectList
- getWebserviceParameters
- getWsCarriers
- getWsShops
- getWsStockValue
- getWsStocks
- hydrate
- hydrateCollection
- isAssociatedToGroupShop
- isAssociatedToShop
- isCurrentlyUsed
- isEmpty
- isLangMultishop
- makeTranslationFields
- removeCarrier
- resetProductsLocations
- save
- setCarriers
- setDefinitionRetrocompatibility
- setProductLocation
- setShops
- toggleStatus
- update
- validateControler
- validateController
- validateField
- validateFields
- validateFieldsLang
public mixed $definition = array('table' => 'warehouse', 'primary' => 'id_warehouse', 'fields' => array('id_address' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'reference' => array('type' => self::TYPE_STRING, 'validate' => 'isString', 'required' => true, 'size' => 45), 'name' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'required' => true, 'size' => 45), 'id_employee' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'management_type' => array('type' => self::TYPE_STRING, 'validate' => 'isStockManagement', 'required' => true), 'id_currency' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'deleted' => array('type' => self::TYPE_BOOL)))
- Visibility: public
- This property is static.
- Source: classes/stock/Warehouse.php line 65.
public boolean $deleted
- Visibility: public
- Source: classes/stock/Warehouse.php line 54.
public integer $id
- Visibility: public
- Source: classes/stock/Warehouse.php line 36.
public integer $id_address
- Visibility: public
- Source: classes/stock/Warehouse.php line 39.
public integer $id_currency
- Visibility: public
- Source: classes/stock/Warehouse.php line 51.
public integer $id_employee
- Visibility: public
- Source: classes/stock/Warehouse.php line 48.
public \enum $management_type
Describes the way a Warehouse is managed
- Visibility: public
- Source: classes/stock/Warehouse.php line 60.
public string $name
- Visibility: public
- Source: classes/stock/Warehouse.php line 45.
public string $reference
- Visibility: public
- Source: classes/stock/Warehouse.php line 42.
protected mixed $webserviceParameters = array('fields' => array('id_address' => array('xlink_resource' => 'addresses'), 'id_employee' => array('xlink_resource' => 'employees'), 'id_currency' => array('xlink_resource' => 'currencies'), 'valuation' => array('getter' => 'getWsStockValue', 'setter' => false), 'deleted' => array()), 'associations' => array('stocks' => array('resource' => 'stock', 'fields' => array('id' => array())), 'carriers' => array('resource' => 'carrier', 'fields' => array('id' => array())), 'shops' => array('resource' => 'shop', 'fields' => array('id' => array(), 'name' => array()))))
- Visibility: protected
- Source: classes/stock/Warehouse.php line 82.
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.
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.
mixed ObjectModelCore::__construct(integer $id, integer $id_lang, integer $id_shop)
Build object
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 150
- $id integer - Existing object id in order to load object (optional)
- $id_lang integer - Required if object is multilingual (optional)
- $id_shop integer - ID shop for objects with multishop on langs
boolean ObjectModelCore::add(boolean $autodate, boolean $null_values)
Add current object to database
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 372
- $autodate boolean
- $null_values boolean
mixed ObjectModelCore::addFieldsRequiredDatabase($fields)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 961
- $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 1009
- $id_shops integer|array
- $type string
mixed ObjectModelCore::clearCache($all)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 975
- $all mixed
boolean ObjectModelCore::delete()
Delete current object from database
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 517
boolean ObjectModelCore::deleteImage()
Delete images associated with the object
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1079
boolean ObjectModelCore::deleteSelection(array $selection)
Delete several objects from database
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 553
- $selection array
mixed ObjectModelCore::displayFieldName($field, $className, $htmlentities, \Context $context)
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 740
- $field mixed
- $className mixed
- $htmlentities mixed
- $context Context
mixed ObjectModelCore::duplicateShops($id)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1049
- $id mixed
boolean WarehouseCore::exists(integer $id_warehouse)
Checks if the given warehouse exists
- Visibility: public
- This method is static.
- Source: classes/stock/Warehouse.php line 231
- $id_warehouse integer
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 1113
- $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 WarehouseCore::getCarriers()
Gets the carriers associated to the current warehouse
- Visibility: public
- Source: classes/stock/Warehouse.php line 156
mixed ObjectModelCore::getDefinition($class, $field)
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1209
- $class mixed
- $field mixed
mixed ObjectModelCore::getEntity($entity)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1269
- $entity mixed
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 234
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 953
- $all mixed
integer WarehouseCore::getNumberOfProducts()
Gets the number of products in the current warehouse
- Visibility: public
- Source: classes/stock/Warehouse.php line 374
string WarehouseCore::getProductLocation(integer $id_product, integer $id_product_attribute, integer $id_warehouse)
For a given {product, product attribute} gets its location in the given warehouse
- Visibility: public
- This method is static.
- Source: classes/stock/Warehouse.php line 286
- $id_product integer
- $id_product_attribute integer
- $id_warehouse integer
array WarehouseCore::getProductWarehouseList(integer $id_product, integer $id_product_attribute, integer $id_shop)
For a given {product, product attribute} gets warehouse list
- Visibility: public
- This method is static.
- Source: classes/stock/Warehouse.php line 306
- $id_product integer
- $id_product_attribute integer
- $id_shop integer
integer WarehouseCore::getQuantitiesOfProducts()
Gets the number of quantities - for all products - in the current warehouse
- Visibility: public
- Source: classes/stock/Warehouse.php line 394
array WarehouseCore::getShops()
Gets the shops (id and name) associated to the current warehouse
- Visibility: public
- Source: classes/stock/Warehouse.php line 118
integer WarehouseCore::getStockValue()
Gets the value of the stock in the current warehouse
- Visibility: public
- Source: classes/stock/Warehouse.php line 411
mixed ObjectModelCore::getTranslationsFields($fieldsArray)
- Visibility: protected
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 589
- $fieldsArray mixed
array ObjectModelCore::getValidationRules(string $className)
Returns object validation rules (fields validity)
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 130
- $className string - Child class name for static use (optional)
string WarehouseCore::getWarehouseNameById(integer $id_warehouse)
For a given $id_warehouse, returns its name
- Visibility: public
- This method is static.
- Source: classes/stock/Warehouse.php line 467
- $id_warehouse integer
array WarehouseCore::getWarehouses(boolean $ignore_shop, integer $id_shop)
Gets available warehouses It is possible via ignore_shop and id_shop to filter the list with shop id
- Visibility: public
- This method is static.
- Source: classes/stock/Warehouse.php line 332
- $ignore_shop boolean - false by default
- $id_shop integer - null by default
array WarehouseCore::getWarehousesByEmployee(integer $id_employee)
For a given employee, gets the warehouse(s) he manages
- Visibility: public
- This method is static.
- Source: classes/stock/Warehouse.php line 427
- $id_employee integer
array WarehouseCore::getWarehousesByProductId(integer $id_product, integer $id_product_attribute)
For a given product, returns the warehouses it is stored in
- Visibility: public
- This method is static.
- Source: classes/stock/Warehouse.php line 444
- $id_product integer
- $id_product_attribute integer
array WarehouseCore::getWarehousesGroupedByShops()
Gets ids of warehouses, grouped by ids of shops
- Visibility: public
- This method is static.
- Source: classes/stock/Warehouse.php line 354
mixed ObjectModelCore::getWebserviceObjectList($sql_join, $sql_filter, $sql_sort, $sql_limit)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 929
- $sql_join mixed
- $sql_filter mixed
- $sql_sort mixed
- $sql_limit mixed
mixed ObjectModelCore::getWebserviceParameters($wsParamsAttributeName)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 799
- $wsParamsAttributeName mixed
array WarehouseCore::getWsCarriers()
Webservice : gets the ids carriers associated to this warehouse
- Visibility: public
- Source: classes/stock/Warehouse.php line 519
array WarehouseCore::getWsShops()
Webservice : gets the ids shops associated to this warehouse
- Visibility: public
- Source: classes/stock/Warehouse.php line 503
integer WarehouseCore::getWsStockValue()
Webservice : gets the value of the warehouse
- Visibility: public
- Source: classes/stock/Warehouse.php line 480
array WarehouseCore::getWsStocks()
Webservice : gets the ids stock associated to this warehouse
- Visibility: public
- Source: classes/stock/Warehouse.php line 489
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 1148
- $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 1167
- $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 1035
- $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 990
- $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 1131
- $table string - name of table linked to entity
- $has_active_column boolean - true if the table has an active column
boolean WarehouseCore::isEmpty()
Checks if a warehouse is empty - i.e. holds no stock
- Visibility: public
- Source: classes/stock/Warehouse.php line 216
mixed ObjectModelCore::isLangMultishop()
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1069
mixed ObjectModelCore::makeTranslationFields($fields, $fieldsArray, $id_language)
- Visibility: protected
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 605
- $fields mixed
- $fieldsArray mixed
- $id_language mixed
mixed WarehouseCore::removeCarrier(integer $id_carrier, integer $id_warehouse)
For a given carrier, removes it from the warehouse/carrier association If $id_warehouse is set, it only removes the carrier for this warehouse
- Visibility: public
- This method is static.
- Source: classes/stock/Warehouse.php line 203
- $id_carrier integer
- $id_warehouse integer - optional
mixed WarehouseCore::resetProductsLocations()
Reset all product locations for this warehouse
- Visibility: public
- Source: classes/stock/Warehouse.php line 271
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 WarehouseCore::setCarriers(array $ids_carriers)
Sets the carriers associated to the current warehouse
- Visibility: public
- Source: classes/stock/Warehouse.php line 179
- $ids_carriers array
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 1224
boolean WarehouseCore::setProductLocation(integer $id_product, integer $id_product_attribute, integer $id_warehouse, string $location)
For a given {product, product attribute} sets its location in the given warehouse
- Visibility: public
- This method is static.
- Source: classes/stock/Warehouse.php line 250
- $id_product integer
- $id_product_attribute integer
- $id_warehouse integer
- $location string
mixed WarehouseCore::setShops(array $ids_shop)
Sets the shops associated to the current warehouse
- Visibility: public
- Source: classes/stock/Warehouse.php line 135
- $ids_shop array
boolean ObjectModelCore::toggleStatus()
Toggle object status in database
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 569
boolean ObjectModelCore::update(boolean $null_values)
Update current object to database
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 444
- $null_values boolean
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 753
- $htmlentities mixed
mixed ObjectModelCore::validateController($htmlentities)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 759
- $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 704
- $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 643
- $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 669
- $die boolean
- $error_return boolean