Files
2025-08-02 16:30:27 +02:00

33 lines
790 B
PHP

<?php
namespace KupShop\KupShopBundle\Context\Wrapper;
use KupShop\KupShopBundle\Template\EntityWrapper;
use KupShop\KupShopBundle\Template\ObjectWrapper;
use KupShop\KupShopBundle\Util\Compat\ServiceContainer;
class ContextWrapper extends ObjectWrapper
{
protected $allowed_methods = ['*'];
public function getActive()
{
$entity = $this->object->getActive();
if (!$entity) {
return null;
}
return ServiceContainer::getService(EntityWrapper::class)->setObject($entity);
}
public function getSupported()
{
$entities = $this->object->getSupported();
return array_map(function ($x) {
return ServiceContainer::getService(EntityWrapper::class)->setObject($x);
}, $entities);
}
}