mirror of
https://github.com/openclassify/openclassify.git
synced 2026-04-16 12:12:09 -05:00
29 lines
579 B
PHP
29 lines
579 B
PHP
<?php namespace Visiosoft\AdvsModule;
|
|
|
|
use Anomaly\Streams\Platform\Addon\Plugin\Plugin;
|
|
use Visiosoft\AdvsModule\Adv\Command\GetAd;
|
|
|
|
class AdvsModulePlugin extends Plugin
|
|
{
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function getFunctions()
|
|
{
|
|
return [
|
|
new \Twig_SimpleFunction(
|
|
'adDetail',
|
|
function ($id) {
|
|
|
|
if (!$ad = $this->dispatch(new GetAd($id))) {
|
|
return null;
|
|
}
|
|
|
|
return $ad;
|
|
}
|
|
)
|
|
];
|
|
}
|
|
}
|