improve code
This commit is contained in:
parent
efdc63225e
commit
895ea19f89
@ -36,19 +36,17 @@ class orderOverviewPdfGenerator
|
||||
*/
|
||||
public function generatePdf(Order $order, $sFilename, $iSelLang = 0, $target = 'I')
|
||||
{
|
||||
$Pdf= $this->getPdfClass($order);
|
||||
$Pdf= $this->getPdfClass();
|
||||
|
||||
$Pdf->setOrder($order);
|
||||
$Pdf->genPdf($sFilename, $iSelLang, $target);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Order $order
|
||||
*
|
||||
* @return pdfdocumentsOrderInterface
|
||||
* @throws noPdfHandlerFoundException
|
||||
*/
|
||||
public function getPdfClass(Order $order)
|
||||
public function getPdfClass()
|
||||
{
|
||||
$requestedType = Registry::getRequest()->getRequestParameter('pdftype');
|
||||
|
||||
|
@ -15,9 +15,11 @@
|
||||
|
||||
namespace D3\PdfDocuments\Application\Model\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
||||
class noBaseObjectSetException extends pdfGeneratorExceptionAbstract
|
||||
{
|
||||
public function __construct( $sMessage = "no base object (e.g. order) for pdf generator set", $iCode = 0, \Exception $previous = null )
|
||||
public function __construct( $sMessage = "no base object (e.g. order) for pdf generator set", $iCode = 0, Exception $previous = null )
|
||||
{
|
||||
parent::__construct( $sMessage, $iCode, $previous );
|
||||
}
|
||||
|
@ -15,6 +15,8 @@
|
||||
|
||||
namespace D3\PdfDocuments\Application\Model\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
||||
class noPdfHandlerFoundException extends pdfGeneratorExceptionAbstract
|
||||
{
|
||||
/**
|
||||
@ -23,9 +25,9 @@ class noPdfHandlerFoundException extends pdfGeneratorExceptionAbstract
|
||||
* @param $requestId
|
||||
* @param string $sMessage
|
||||
* @param int $iCode
|
||||
* @param \Exception|null $previous
|
||||
* @param Exception|null $previous
|
||||
*/
|
||||
public function __construct( $requestId, $sMessage = "no pdf handler defined for given request id", $iCode = 0, \Exception $previous = null )
|
||||
public function __construct( $requestId, $sMessage = "no pdf handler defined for given request id", $iCode = 0, Exception $previous = null )
|
||||
{
|
||||
$sMessage .= ' "'.$requestId.'"';
|
||||
parent::__construct( $sMessage, $iCode, $previous );
|
||||
|
@ -15,9 +15,11 @@
|
||||
|
||||
namespace D3\PdfDocuments\Application\Model\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
||||
class wrongPdfGeneratorInterface extends pdfGeneratorExceptionAbstract
|
||||
{
|
||||
public function __construct( $requiredInterface, $sMessage = "generator class doesn't fulfilled the interface", $iCode = 0, \Exception $previous = null ) {
|
||||
public function __construct( $requiredInterface, $sMessage = "generator class doesn't fulfilled the interface", $iCode = 0, Exception $previous = null ) {
|
||||
|
||||
$sMessage .= $requiredInterface;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user