openclassify/addons/default/visiosoft/profile-module/src/ProfileModulePlugin.php
2020-03-04 11:55:09 +03:00

28 lines
602 B
PHP

<?php namespace Visiosoft\ProfileModule;
use Anomaly\Streams\Platform\Addon\Plugin\Plugin;
use Visiosoft\ProfileModule\Adress\Command\GetAddress;
class ProfileModulePlugin extends Plugin
{
/**
* @return array
*/
public function getFunctions()
{
return [
new \Twig_SimpleFunction(
'getAddress',
function ($id) {
if (!$ad = $this->dispatch(new GetAddress($id))) {
return null;
}
return $ad;
}
)
];
}
}