Hi!
I would like to override TcpdfEntityPrinter class with a custom class. PrinterController is instantiating TcpdfEntityPrinter.
So I added:
custom/Espo/Modules/Course/Binding.php
But my CustomEntityPrinter is not being used. Other bindings in this file are being used so it seems like I created the file correctly.
custom/Espo/Modules/Course/CustomEntityPrinter.php
What am I doing wrong?
I would like to override TcpdfEntityPrinter class with a custom class. PrinterController is instantiating TcpdfEntityPrinter.
So I added:
custom/Espo/Modules/Course/Binding.php
PHP Code:
namespace Espo\Modules\Course;
use Espo\Core\Binding\Binder;
use Espo\Tools\Pdf\Tcpdf\TcpdfEntityPrinter;
use Espo\Tools\Pdf\PrinterController;
class Binding
{
public function process(Binder $binder)
{
$binder
->for(PrinterController::class)
->bindImplementation(TcpdfEntityPrinter::class, CustomEntityPrinter::class);
}
}
custom/Espo/Modules/Course/CustomEntityPrinter.php
PHP Code:
namespace Espo\Modules\Course;
class CustomEntityPrinter implements EntityPrinter
{
....
}
Comment