Inital commit
This commit is contained in:
42
local/modules/RibClient/Hook/HookManager.php
Normal file
42
local/modules/RibClient/Hook/HookManager.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* Copyright (c) Franck Allimant, CQFDev */
|
||||
/* email : thelia@cqfdev.fr */
|
||||
/* web : http://www.cqfdev.fr */
|
||||
/* */
|
||||
/* For the full copyright and license information, please view the LICENSE */
|
||||
/* file that was distributed with this source code. */
|
||||
/*************************************************************************************/
|
||||
|
||||
/**
|
||||
* Created by Franck Allimant, CQFDev <franck@cqfdev.fr>
|
||||
* Date: 13/04/2019 22:47
|
||||
*/
|
||||
namespace RibClient\Hook;
|
||||
|
||||
use RibClient\Model\RibClientQuery;
|
||||
use Thelia\Core\Event\Hook\HookRenderEvent;
|
||||
use Thelia\Core\Hook\BaseHook;
|
||||
|
||||
class HookManager extends BaseHook
|
||||
{
|
||||
public function onCustomerEdit(HookRenderEvent $event)
|
||||
{
|
||||
$customerId = $event->getArgument('customer_id');
|
||||
|
||||
if (null !== $cv = RibClientQuery::create()->findOneByCustomerId($customerId)) {
|
||||
$echeance = $cv->getEcheance();
|
||||
} else {
|
||||
$echeance = '';
|
||||
}
|
||||
|
||||
$event->add(
|
||||
$this->render(
|
||||
"rib-client/customer-configuration.html",
|
||||
[
|
||||
'echeance' => $echeance
|
||||
]
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user