diff --git a/src/Model/Brand.php b/src/Model/Brand.php index d58be5c1..2fbc56b0 100644 --- a/src/Model/Brand.php +++ b/src/Model/Brand.php @@ -4,6 +4,8 @@ namespace Loevgaard\SyliusBrandPlugin\Model; +use JMS\Serializer\Annotation as Serializer; + class Brand implements BrandInterface { use ProductsAwareTrait { @@ -13,13 +15,22 @@ class Brand implements BrandInterface ImagesAwareTrait::__construct as private __imagesAwareTraitConstruct; } - /** @var int */ + /** + * @var int + * @Serializer\Groups({"Autocomplete"}) + */ protected $id; - /** @var string|null */ + /** + * @var string|null + * @Serializer\Groups({"Autocomplete"}) + */ protected $code; - /** @var string|null */ + /** + * @var string|null + * @Serializer\Groups({"Autocomplete"}) + */ protected $name; public function __construct() diff --git a/src/Resources/config/routing/admin/ajax/brand.yaml b/src/Resources/config/routing/admin/ajax/brand.yaml index 240598c6..c4c4732b 100644 --- a/src/Resources/config/routing/admin/ajax/brand.yaml +++ b/src/Resources/config/routing/admin/ajax/brand.yaml @@ -2,7 +2,7 @@ loevgaard_sylius_brand_admin_ajax_brands_by_phrase: path: /search methods: [GET] defaults: - _controller: loevgaard_sylius_brand.controller.brand:indexAction + _controller: loevgaard_sylius_brand.controller.brand::indexAction _format: json _sylius: serialization_groups: [Autocomplete] @@ -16,7 +16,7 @@ loevgaard_sylius_brand_admin_ajax_brand_by_code: path: / methods: [GET] defaults: - _controller: loevgaard_sylius_brand.controller.brand:indexAction + _controller: loevgaard_sylius_brand.controller.brand::indexAction _format: json _sylius: serialization_groups: [Autocomplete]