first commit
This commit is contained in:
19
class/smarty_plugins/function.get_delivery_dispatch_date.php
Normal file
19
class/smarty_plugins/function.get_delivery_dispatch_date.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
function smarty_function_get_delivery_dispatch_date($params, &$smarty)
|
||||
{
|
||||
if (empty($params['delivery'])) {
|
||||
throw new InvalidArgumentException('Missing parameter \'delivery\'');
|
||||
}
|
||||
|
||||
/** @var Delivery $delivery */
|
||||
$delivery = $params['delivery'];
|
||||
|
||||
$dispatchDate = $delivery->getDispatchDate();
|
||||
|
||||
if (!empty($params['assign'])) {
|
||||
$smarty->assign($params['assign'], $dispatchDate);
|
||||
} else {
|
||||
return $dispatchDate;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user