mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-11-22 21:03:01 +09:00
If there is promo with same code created already, do not let create new one
This commit is contained in:
1 parent
a321d50fdf
commit
199cddba21
1 file changed
+4
@@ -567,6 +567,10 @@ class Service implements InjectionAwareInterface
|
||||
|
||||
public function createPromo($code, $type, $value, $products = array(), $periods = array(), $clientGroups = array(), $data)
|
||||
{
|
||||
if ($this->di['db']->findOne('Promo', 'code = :code', array(':code' => $code))){
|
||||
throw new \Box_Exception('This promo code already exists.');
|
||||
}
|
||||
|
||||
$systemService = $this->di['mod_service']('system');
|
||||
$systemService->checkLimits('Model_Promo', 2);
|
||||
|
||||
|
||||
Reference in new issue
Block a user