Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
49 lines (39 sloc) 1.04 KB
<?php
declare(strict_types=1);
namespace Netgen\Layouts\Sylius\Item\ValueConverter;
use Netgen\Layouts\Item\ValueConverterInterface;
use Sylius\Component\Product\Model\ProductInterface;
/**
* @implements \Netgen\Layouts\Item\ValueConverterInterface<\Sylius\Component\Product\Model\ProductInterface>
*/
final class ProductValueConverter implements ValueConverterInterface
{
public function supports(object $object): bool
{
return $object instanceof ProductInterface;
}
public function getValueType(object $object): string
{
return 'sylius_product';
}
public function getId(object $object)
{
return $object->getId();
}
public function getRemoteId(object $object)
{
return $object->getId();
}
public function getName(object $object): string
{
return (string) $object->getName();
}
public function getIsVisible(object $object): bool
{
return true;
}
public function getObject(object $object): object
{
return $object;
}
}
You can’t perform that action at this time.