Skip to content

Commit dc91ecb

Browse files
review fixes
1 parent 4db77ba commit dc91ecb

File tree

3 files changed

+13
-19
lines changed

3 files changed

+13
-19
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery;
4+
use Ibexa\Contracts\ProductCatalogSymbolAttribute\Search\Criterion\SymbolAttribute;
5+
6+
$query = new ProductQuery();
7+
$query->setFilter(new SymbolAttribute('ean', ['5023920187205']));
8+
/** @var \Ibexa\Contracts\ProductCatalog\ProductServiceInterface $productService*/
9+
$results = $productService->findProducts($query);

docs/pim/symbol_attribute_type.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,9 @@ To store symbol attribute values, the `IbexaProductCatalogSymbolAttributeBundle`
4040
The following SQL query can be used to build the required database structure:
4141

4242
``` sql
43-
create table ibexa_product_specification_attribute_symbol (
44-
id int not null primary key,
45-
value varchar(255) null,
46-
constraint ibexa_product_specification_attribute_symbol_fk
47-
foreign key (id) references ibexa_product_specification_attribute (id)
48-
on update cascade on delete cascade
49-
) collate = utf8mb4_unicode_520_ci;
50-
51-
create index ibexa_product_specification_attribute_symbol_value_idx
52-
on ibexa_product_specification_attribute_symbol (value);
43+
CREATE TABLE ibexa_product_specification_attribute_symbol (id INT NOT NULL, value VARCHAR(160) DEFAULT NULL, PRIMARY KEY(id));
44+
CREATE INDEX ibexa_product_specification_attribute_symbol_value_idx ON ibexa_product_specification_attribute_symbol (value);
45+
ALTER TABLE ibexa_product_specification_attribute_symbol ADD CONSTRAINT ibexa_product_specification_attribute_symbol_fk FOREIGN KEY (id) REFERENCES ibexa_product_specification_attribute (id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE;
5346
```
5447

5548
### Create symbol attribute definition (optional)

docs/search/criteria_reference/symbolattribute_criterion.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,5 @@ The `SymbolAttribute` Search Criterion searches for products by [symbol attribut
1717
### PHP
1818

1919
``` php
20-
<?php
21-
22-
use Ibexa\Contracts\ProductCatalog\Values\Product\ProductQuery;
23-
use Ibexa\Contracts\ProductCatalogSymbolAttribute\Search\Criterion\SymbolAttribute;
24-
25-
$query = new ProductQuery();
26-
$query->setFilter(new SymbolAttribute('ean', ['5023920187205']));
27-
/** @var \Ibexa\Contracts\ProductCatalog\ProductServiceInterface $productService*/
28-
$results = $productService->findProducts($query);
20+
[[= include_file(‘code_samples/back_office/search/src/Query/SymbolAttributeTypeQuery.php’) =]]
2921
```

0 commit comments

Comments
 (0)