Working cleaning

This commit is contained in:
gmorel
2013-10-21 23:09:04 +02:00
parent 42aa46905b
commit 9c7c4e851e
17 changed files with 37 additions and 2185 deletions

View File

@@ -28,7 +28,6 @@ use Symfony\Component\Routing\Router;
use Thelia\Condition\ConditionFactory;
use Thelia\Condition\ConditionManagerInterface;
use Thelia\Core\Event\AdminResources;
use Thelia\Core\Event\Condition\ConditionCreateOrUpdateEvent;
use Thelia\Core\Event\Coupon\CouponConsumeEvent;
use Thelia\Core\Event\Coupon\CouponCreateOrUpdateEvent;
use Thelia\Core\Event\TheliaEvents;
@@ -331,10 +330,6 @@ class CouponController extends BaseAdminController
$conditions->add(clone $condition);
}
// $coupon->setSerializedConditions(
// $conditionFactory->serializeCouponConditionCollection($conditions)
// );
$couponEvent = new CouponCreateOrUpdateEvent(
$coupon->getCode(),
$coupon->getTitle(),
@@ -381,31 +376,6 @@ class CouponController extends BaseAdminController
);
}
/**
* Test Coupon consuming
*
* @param string $couponCode Coupon code
*
* @todo remove (event dispatcher testing purpose)
*
*/
public function consumeAction($couponCode)
{
// @todo remove (event dispatcher testing purpose)
$couponConsumeEvent = new CouponConsumeEvent($couponCode);
$eventToDispatch = TheliaEvents::COUPON_CONSUME;
// Dispatch Event to the Action
$this->dispatch(
$eventToDispatch,
$couponConsumeEvent
);
var_dump('test', $couponConsumeEvent->getCode(), $couponConsumeEvent->getDiscount(), $couponConsumeEvent->getIsValid());
exit();
}
/**
* Build a Coupon from its form
*
@@ -600,26 +570,4 @@ class CouponController extends BaseAdminController
return $cleanedConditions;
}
// /**
// * Validation Condition creation
// *
// * @param string $type Condition class type
// * @param string $operator Condition operator (<, >, =, etc)
// * @param array $values Condition values
// *
// * @return bool
// */
// protected function validateConditionsCreation($type, $operator, $values)
// {
// /** @var FacadeInterface $adapter */
// $adapter = $this->container->get('thelia.adapter');
// $validator = new PriceParam()
// try {
// $condition = new AvailableForTotalAmount($adapter, $validators);
// $condition = new $type($adapter, $validators);
// } catch (\Exception $e) {
// return false;
// }
// }
}