update api documentation

This commit is contained in:
Manuel Raynaud
2013-08-16 10:11:49 +02:00
parent 1db41a36ab
commit ba36a5af60
1725 changed files with 924982 additions and 272089 deletions

View File

@@ -4,7 +4,7 @@ namespace Thelia\Model;
use Propel\Runtime\Connection\ConnectionInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Thelia\Core\Event\CartEvent;
use Thelia\Core\Event\Internal\CartEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Model\Base\CartItem as BaseCartItem;
use Thelia\Model\ConfigQuery;
@@ -23,7 +23,7 @@ class CartItem extends BaseCartItem
if ($this->dispatcher) {
$cartEvent = new CartEvent($this->getCart());
$this->dispatcher->dispatch(TheliaEvents::CART_ADDITEM, $cartEvent);
$this->dispatcher->dispatch(TheliaEvents::AFTER_CARTADDITEM, $cartEvent);
}
}
@@ -32,7 +32,7 @@ class CartItem extends BaseCartItem
if ($this->dispatcher) {
$cartEvent = new CartEvent($this->getCart());
$this->dispatcher->dispatch(TheliaEvents::CART_MODIFYITEM, $cartEvent);
$this->dispatcher->dispatch(TheliaEvents::AFTER_CARTCHANGEITEM, $cartEvent);
}
}
@@ -41,27 +41,25 @@ class CartItem extends BaseCartItem
* @param $value
* @return $this
*/
public function addQuantity($value)
public function updateQuantity($value)
{
$currentQuantity = $this->getQuantity();
$newQuantity = $currentQuantity + $value;
if($newQuantity <= 0)
if($value <= 0)
{
$newQuantity = $currentQuantity;
$value = $currentQuantity;
}
if(ConfigQuery::read("verifyStock", 1) == 1)
{
$productSaleElements = $this->getProductSaleElements();
if($productSaleElements->getQuantity() < $newQuantity) {
$newQuantity = $currentQuantity;
if($productSaleElements->getQuantity() < $value) {
$value = $currentQuantity;
}
}
$this->setQuantity($newQuantity);
$this->setQuantity($value);
return $this;
}