// Webservice: Stock

This commit is contained in:
bMancone
2011-12-19 18:34:31 +00:00
parent 7c5ad0049d
commit 2e4c8bb553
9 changed files with 469 additions and 17 deletions
+24
View File
@@ -78,6 +78,20 @@ class StockCore extends ObjectModel
),
);
/**
* @see ObjectModel::$webserviceParameters
*/
protected $webserviceParameters = array(
'fields' => array(
'id_warehouse' => array('xlink_resource' => 'warehouses'),
'id_product' => array('xlink_resource' => 'products'),
'id_product_attribute' => array('xlink_resource' => 'combinations'),
'real_quantity' => array('getter' => 'getWsRealQuantity', 'setter' => false),
),
'hidden_fields' => array(
),
);
/**
* @see ObjectModel::update()
*/
@@ -130,4 +144,14 @@ class StockCore extends ObjectModel
}
}
}
/**
* Webservice : used to get the real quantity of a product
*/
public function getWsRealQuantity()
{
$manager = StockManagerFactory::getManager();
$quantity = $manager->getProductRealQuantities($this->id_product, $this->id_product_attribute, $this->id_warehouse, true);
return $quantity;
}
}