Inital commit
This commit is contained in:
@@ -15,9 +15,8 @@ namespace Thelia\Exception;
|
||||
/**
|
||||
* Class AdminAccessDenied
|
||||
* @package Thelia\Exception
|
||||
* @author Manuel Raynaud <mraynaud@openstudio.fr>
|
||||
* @author Manuel Raynaud <manu@raynaud.io>
|
||||
*/
|
||||
class AdminAccessDenied extends \RuntimeException
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
38
core/lib/Thelia/Exception/CouponNotReleaseException.php
Normal file
38
core/lib/Thelia/Exception/CouponNotReleaseException.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* This file is part of the Thelia package. */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : dev@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* For the full copyright and license information, please view the LICENSE.txt */
|
||||
/* file that was distributed with this source code. */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Exception;
|
||||
|
||||
use Thelia\Core\Translation\Translator;
|
||||
use Thelia\Log\Tlog;
|
||||
|
||||
/**
|
||||
* Class CouponNotReleaseException
|
||||
* @package Thelia\Exception
|
||||
* @author Baixas Alban <abaixas@openstudio.fr>
|
||||
*/
|
||||
class CouponNotReleaseException extends \Exception
|
||||
{
|
||||
/**
|
||||
* CouponNotReleaseException thrown when a Coupon is not release
|
||||
*
|
||||
* @param string $couponCode Coupon code
|
||||
*/
|
||||
public function __construct($couponCode)
|
||||
{
|
||||
$message = Translator::getInstance()->trans('Coupon %code is not release.', ['%code' => $couponCode]);
|
||||
|
||||
Tlog::getInstance()->addWarning($message);
|
||||
|
||||
parent::__construct($message);
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ namespace Thelia\Exception;
|
||||
/**
|
||||
* Class CustomerException
|
||||
* @package Thelia\Exception
|
||||
* @author Manuel Raynaud <mraynaud@openstudio.fr>
|
||||
* @author Manuel Raynaud <manu@raynaud.io>
|
||||
*/
|
||||
class CustomerException extends \RuntimeException
|
||||
{
|
||||
|
||||
@@ -19,5 +19,4 @@ namespace Thelia\Exception;
|
||||
*/
|
||||
class FileNotFoundException extends \ErrorException
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -19,5 +19,4 @@ namespace Thelia\Exception;
|
||||
*/
|
||||
class FileNotReadableException extends \Exception
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -19,5 +19,4 @@ namespace Thelia\Exception;
|
||||
*/
|
||||
class HttpUrlException extends \Exception
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
34
core/lib/Thelia/Exception/InactiveCouponException.php
Normal file
34
core/lib/Thelia/Exception/InactiveCouponException.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* This file is part of the Thelia package. */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : dev@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* For the full copyright and license information, please view the LICENSE.txt */
|
||||
/* file that was distributed with this source code. */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Exception;
|
||||
|
||||
use Thelia\Core\Translation\Translator;
|
||||
use Thelia\Log\Tlog;
|
||||
|
||||
/**
|
||||
* Class InactiveCouponException
|
||||
* @package Thelia\Exception
|
||||
* @author Manuel Raynaud <manu@raynaud.io>
|
||||
*/
|
||||
class InactiveCouponException extends \RuntimeException
|
||||
{
|
||||
|
||||
public function __construct($couponCode)
|
||||
{
|
||||
$message = Translator::getInstance()->trans('Coupon code %code is disabled.', ['%code' => $couponCode ]);
|
||||
|
||||
Tlog::getInstance()->addWarning($message);
|
||||
|
||||
parent::__construct($message);
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,6 @@ class InvalidConditionException extends \RuntimeException
|
||||
*/
|
||||
public function __construct($className)
|
||||
{
|
||||
|
||||
$message = 'Invalid Condition given to ' . $className;
|
||||
Tlog::getInstance()->addError($message);
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ class InvalidConditionValueException extends \RuntimeException
|
||||
*/
|
||||
public function __construct($className, $parameter)
|
||||
{
|
||||
|
||||
$message = 'Invalid Parameter for Condition ' . $className . ' on parameter ' . $parameter;
|
||||
Tlog::getInstance()->addError($message);
|
||||
|
||||
|
||||
50
core/lib/Thelia/Exception/InvalidModuleException.php
Normal file
50
core/lib/Thelia/Exception/InvalidModuleException.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* This file is part of the Thelia package. */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : dev@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* For the full copyright and license information, please view the LICENSE.txt */
|
||||
/* file that was distributed with this source code. */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Exception;
|
||||
|
||||
/**
|
||||
* Class InvalidModuleException
|
||||
* @package Thelia\Exception
|
||||
* @author Julien Chanséaume <jchanseaume@openstudio.fr>
|
||||
*/
|
||||
class InvalidModuleException extends \RuntimeException
|
||||
{
|
||||
protected $errors = [];
|
||||
|
||||
public function __construct(array $errors = [])
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->errors = $errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getErrors()
|
||||
{
|
||||
return $this->errors;
|
||||
}
|
||||
|
||||
public function getErrorsAsString($separator = "\n")
|
||||
{
|
||||
$message = '';
|
||||
|
||||
/** @var \Exception $error */
|
||||
foreach ($this->errors as $error) {
|
||||
$message .= $error->getMessage() . $separator;
|
||||
}
|
||||
|
||||
return rtrim($message, $separator);
|
||||
}
|
||||
}
|
||||
@@ -14,5 +14,4 @@ namespace Thelia\Exception;
|
||||
|
||||
class MemberAccessException extends \LogicException
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -23,5 +23,4 @@ use Symfony\Component\DependencyInjection\Exception\BadMethodCallException;
|
||||
*/
|
||||
class NotImplementedException extends BadMethodCallException
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
23
core/lib/Thelia/Exception/UnmatchableConditionException.php
Normal file
23
core/lib/Thelia/Exception/UnmatchableConditionException.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* This file is part of the Thelia package. */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : dev@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* For the full copyright and license information, please view the LICENSE.txt */
|
||||
/* file that was distributed with this source code. */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Exception;
|
||||
|
||||
/**
|
||||
* Class UnmatchableConditionException
|
||||
* UnmatchableConditionException thrown when a condition can't be check (if customer is not connected)
|
||||
* @package Thelia\Exception
|
||||
* @author Baixas Alban <abaixas@openstudio.fr>
|
||||
*/
|
||||
class UnmatchableConditionException extends \RuntimeException
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user