Properties

$id

$id : integer

Type

integer — identifier of the warehouse

$id_address

$id_address : integer

Type

integer — Id of the address associated to the warehouse

$reference

$reference : string

Type

string — Reference of the warehouse

$name

$name : string

Type

string — Name of the warehouse

$id_employee

$id_employee : integer

Type

integer — Id of the employee who manages the warehouse

$id_currency

$id_currency : integer

Type

integer — Id of the valuation currency of the warehouse

$deleted

$deleted : boolean

Type

boolean — True if warehouse has been deleted (hence, no deletion in DB)

$management_type

$management_type : \enum

Describes the way a Warehouse is managed

Type

\enum — WA|LIFO|FIFO

$definition

$definition : 

Type

$webserviceParameters

$webserviceParameters : 

Type

Methods

getShops()

getShops() : array

Gets the shops associated to the current warehouse

Returns

array —

Shops (id, name)

getCarriers()

getCarriers(  $return_reference = false) : array

Gets the carriers associated to the current warehouse

Parameters

$return_reference

Returns

array —

Ids of the associated carriers

setCarriers()

setCarriers(array  $ids_carriers) 

Sets the carriers associated to the current warehouse

Parameters

array $ids_carriers

removeCarrier()

removeCarrier(integer  $id_carrier, integer  $id_warehouse = null) 

For a given carrier, removes it from the warehouse/carrier association If $id_warehouse is set, it only removes the carrier for this warehouse

Parameters

integer $id_carrier

Id of the carrier to remove

integer $id_warehouse

optional Id of the warehouse to filter

isEmpty()

isEmpty() : boolean

Checks if a warehouse is empty - i.e. has no stock

Returns

boolean

exists()

exists(integer  $id_warehouse) : boolean

Checks if the given warehouse exists

Parameters

integer $id_warehouse

Returns

boolean —

Exists/Does not exist

setProductLocation()

setProductLocation(integer  $id_product, integer  $id_product_attribute, integer  $id_warehouse, string  $location) : boolean

For a given {product, product attribute} sets its location in the given warehouse First, for the given parameters, it cleans the database before updating

Parameters

integer $id_product

ID of the product

integer $id_product_attribute

Use 0 if this product does not have attributes

integer $id_warehouse

ID of the warehouse

string $location

Describes the location (no lang id required)

Returns

boolean —

Success/Failure

resetProductsLocations()

resetProductsLocations() 

Resets all product locations for this warehouse

getProductLocation()

getProductLocation(integer  $id_product, integer  $id_product_attribute, integer  $id_warehouse) : string

For a given {product, product attribute} gets its location in the given warehouse

Parameters

integer $id_product

ID of the product

integer $id_product_attribute

Use 0 if this product does not have attributes

integer $id_warehouse

ID of the warehouse

Returns

string —

Location of the product

getProductWarehouseList()

getProductWarehouseList(integer  $id_product, integer  $id_product_attribute, integer  $id_shop = null) : array

For a given {product, product attribute} gets warehouse list

Parameters

integer $id_product

ID of the product

integer $id_product_attribute

Optional, uses 0 if this product does not have attributes

integer $id_shop

Optional, ID of the shop. Uses the context shop id (@see Context::shop)

Returns

array —

Warehouses (ID, reference/name concatenated)

getWarehouses()

getWarehouses(boolean  $ignore_shop = false, integer  $id_shop = null) : array

Gets available warehouses It is possible via ignore_shop and id_shop to filter the list with shop id

Parameters

boolean $ignore_shop

Optional, false by default - Allows to get only the warehouses that are associated to one/some shops (@see $id_shop)

integer $id_shop

Optional, Context::shop::Id by default - Allows to define a specific shop to filter.

Returns

array —

Warehouses (ID, reference/name concatenated)

getWarehousesGroupedByShops()

getWarehousesGroupedByShops() : array

Gets warehouses grouped by shops

Returns

array —

(of array) Warehouses ID are grouped by shops ID

getNumberOfProducts()

getNumberOfProducts() : integer

Gets the number of products in the current warehouse

Returns

integer —

Number of different id_stock

getQuantitiesOfProducts()

getQuantitiesOfProducts() : integer

Gets the number of quantities - for all products - in the current warehouse

Returns

integer —

Total Quantity

getStockValue()

getStockValue() : integer

Gets the value of the stock in the current warehouse

Returns

integer —

Value of the stock

getWarehousesByEmployee()

getWarehousesByEmployee(integer  $id_employee) : array

For a given employee, gets the warehouse(s) he/she manages

Parameters

integer $id_employee

Manager ID

Returns

array —

ids_warehouse Ids of the warehouses

getWarehousesByProductId()

getWarehousesByProductId(integer  $id_product, integer  $id_product_attribute) : array

For a given product, returns the warehouses it is stored in

Parameters

integer $id_product

Product Id

integer $id_product_attribute

Optional, Product Attribute Id - 0 by default (no attribues)

Returns

array —

Warehouses Ids and names

getWarehouseNameById()

getWarehouseNameById(integer  $id_warehouse) : string

For a given $id_warehouse, returns its name

Parameters

integer $id_warehouse

Warehouse Id

Returns

string —

Name

getPackWarehouses()

getPackWarehouses(integer  $id_product,   $id_shop = null) : array|boolean

For a given pack, returns the warehouse it can be shipped from

Parameters

integer $id_product
$id_shop

Returns

array|boolean —

id_warehouse or false

resetStockAvailable()

resetStockAvailable() 

getWsStockValue()

getWsStockValue() : integer

Webservice : gets the value of the warehouse

Returns

integer

getWsStocks()

getWsStocks() : array

Webservice : gets the ids stock associated to this warehouse

Returns

array

getWsShops()

getWsShops() : array

Webservice : gets the ids shops associated to this warehouse

Returns

array

getWsCarriers()

getWsCarriers() : array

Webservice : gets the ids carriers associated to this warehouse

Returns

array