// Webservice: Stock

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11390 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
bMancone
2011-12-19 18:34:31 +00:00
parent 5d7a120e50
commit 8af781e449
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;
}
}