Skip to content

Commit

Permalink
Update the entity-schema for Shopware 6.5
Browse files Browse the repository at this point in the history
  • Loading branch information
silverDuy committed May 30, 2023
1 parent 772876c commit 3f163ef
Show file tree
Hide file tree
Showing 92 changed files with 622 additions and 638 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to `shopware-php-sdk` will be documented in this file.

Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles.

### 2.0.0
- Updated the entity-schema for Shopware version 6.5

### 1.7.3
- [Fix Schema caching](https://github.com/vienthuong/shopware-php-sdk/pull/62)
- [Loosen Guzzle requirement](https://github.com/vienthuong/shopware-php-sdk/pull/63)
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ If you're familiar with Shopware 6 DAL syntax and how to retrieve it you might s
Or sending notification from external server
![image](https://i.imgur.com/26LdTab.png)

| SDK version | SW schema |
|-------------|:---------:|
| 2.x | 6.5 |
| 1.x | 6.4 |

You can use 1.x to connect to a sw 6.5 but for up-to-date schema and new 6.5 features, you should use 2.x version instead.

## Installation
Install with Composer
```shell
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "A PHP SDK for Shopware 6 Platform",
"type": "library",
"license": "MIT",
"version": "1.7.3",
"version": "2.0.0",
"authors": [
{
"name": "vin",
Expand Down
1 change: 1 addition & 0 deletions src/Data/Entity/App/AppDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public function getSchema() : Schema
new Property('scripts', 'association', new FlagCollection([new Flag('cascade_delete', 1), ]), ['entity' => 'script', 'referenceField' => 'appId', 'localField' => 'id', 'relation' => 'one_to_many', ]),
new Property('webhooks', 'association', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource']]), new Flag('cascade_delete', 1), ]), ['entity' => 'webhook', 'referenceField' => 'appId', 'localField' => 'id', 'relation' => 'one_to_many', ]),
new Property('paymentMethods', 'association', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource']]), new Flag('set_null_on_delete', 1), ]), ['entity' => 'app_payment_method', 'referenceField' => 'appId', 'localField' => 'id', 'relation' => 'one_to_many', ]),
new Property('taxProviders', 'association', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource']]), new Flag('cascade_delete', 1), ]), ['entity' => 'tax_provider', 'referenceField' => 'appId', 'localField' => 'id', 'relation' => 'one_to_many', ]),
new Property('scriptConditions', 'association', new FlagCollection([new Flag('cascade_delete', 1), ]), ['entity' => 'app_script_condition', 'referenceField' => 'appId', 'localField' => 'id', 'relation' => 'one_to_many', ]),
new Property('cmsBlocks', 'association', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource']]), new Flag('cascade_delete', 1), ]), ['entity' => 'app_cms_block', 'referenceField' => 'appId', 'localField' => 'id', 'relation' => 'one_to_many', ]),
new Property('flowActions', 'association', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource']]), new Flag('cascade_delete', 1), ]), ['entity' => 'app_flow_action', 'referenceField' => 'appId', 'localField' => 'id', 'relation' => 'one_to_many', ]),
Expand Down
3 changes: 3 additions & 0 deletions src/Data/Entity/App/AppEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Vin\ShopwareSdk\Data\Entity\Script\ScriptCollection;
use Vin\ShopwareSdk\Data\Entity\Webhook\WebhookCollection;
use Vin\ShopwareSdk\Data\Entity\AppPaymentMethod\AppPaymentMethodCollection;
use Vin\ShopwareSdk\Data\Entity\TaxProvider\TaxProviderCollection;
use Vin\ShopwareSdk\Data\Entity\AppScriptCondition\AppScriptConditionCollection;
use Vin\ShopwareSdk\Data\Entity\AppCmsBlock\AppCmsBlockCollection;
use Vin\ShopwareSdk\Data\Entity\AppFlowAction\AppFlowActionCollection;
Expand Down Expand Up @@ -88,6 +89,8 @@ class AppEntity extends Entity

public ?AppPaymentMethodCollection $paymentMethods = null;

public ?TaxProviderCollection $taxProviders = null;

public ?AppScriptConditionCollection $scriptConditions = null;

public ?AppCmsBlockCollection $cmsBlocks = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public function getSchema() : Schema
new Property('view', 'string', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource']]), new Flag('required', 1), ]), []),
new Property('url', 'string', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource']]), new Flag('required', 1), ]), []),
new Property('action', 'string', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource']]), new Flag('required', 1), ]), []),
new Property('openNewTab', 'boolean', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource']]), new Flag('required', 1), ]), []),
new Property('label', 'string', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource']]), new Flag('required', 1), new Flag('translatable', 1), ]), []),
new Property('translations', 'association', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource']]), new Flag('cascade_delete', 1), new Flag('required', 1), ]), ['entity' => 'app_action_button_translation', 'referenceField' => 'appActionButtonId', 'localField' => 'id', 'relation' => 'one_to_many', ]),
new Property('appId', 'uuid', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource']]), new Flag('required', 1), ]), []),
Expand Down
2 changes: 0 additions & 2 deletions src/Data/Entity/AppActionButton/AppActionButtonEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ class AppActionButtonEntity extends Entity

public ?string $action = null;

public ?bool $openNewTab = null;

public ?string $label = null;

public ?AppActionButtonTranslationCollection $translations = null;
Expand Down
3 changes: 3 additions & 0 deletions src/Data/Entity/Category/CategoryDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ public function getSchema() : Schema
new Property('productAssignmentType', 'string', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource', 'Shopware\Core\Framework\Api\Context\SalesChannelApiSource']]), new Flag('required', 1), ]), []),
new Property('visible', 'boolean', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource', 'Shopware\Core\Framework\Api\Context\SalesChannelApiSource']]), ]), []),
new Property('active', 'boolean', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource', 'Shopware\Core\Framework\Api\Context\SalesChannelApiSource']]), ]), []),
new Property('cmsPageIdSwitched', 'boolean', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource', 'Shopware\Core\Framework\Api\Context\SalesChannelApiSource']]), new Flag('runtime', 1), ]), []),
new Property('visibleChildCount', 'int', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource', 'Shopware\Core\Framework\Api\Context\SalesChannelApiSource']]), new Flag('runtime', 1), ]), []),
new Property('name', 'string', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource', 'Shopware\Core\Framework\Api\Context\SalesChannelApiSource']]), new Flag('required', 1), new Flag('search_ranking', 500), new Flag('translatable', 1), ]), []),
new Property('customFields', 'json_object', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource', 'Shopware\Core\Framework\Api\Context\SalesChannelApiSource']]), new Flag('translatable', 1), ]), []),
new Property('slotConfig', 'json_object', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource']]), new Flag('translatable', 1), ]), []),
Expand All @@ -75,6 +77,7 @@ public function getSchema() : Schema
new Property('cmsPage', 'association', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource', 'Shopware\Core\Framework\Api\Context\SalesChannelApiSource']]), ]), ['entity' => 'cms_page', 'referenceField' => 'id', 'localField' => 'cmsPageId', 'relation' => 'many_to_one', ]),
new Property('productStreamId', 'uuid', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource']]), ]), []),
new Property('productStream', 'association', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource']]), ]), ['entity' => 'product_stream', 'referenceField' => 'id', 'localField' => 'productStreamId', 'relation' => 'many_to_one', ]),
new Property('customEntityTypeId', 'uuid', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource', 'Shopware\Core\Framework\Api\Context\SalesChannelApiSource']]), ]), []),
new Property('navigationSalesChannels', 'association', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource']]), ]), ['entity' => 'sales_channel', 'referenceField' => 'navigationCategoryId', 'localField' => 'id', 'relation' => 'one_to_many', ]),
new Property('footerSalesChannels', 'association', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource']]), ]), ['entity' => 'sales_channel', 'referenceField' => 'footerCategoryId', 'localField' => 'id', 'relation' => 'one_to_many', ]),
new Property('serviceSalesChannels', 'association', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource']]), ]), ['entity' => 'sales_channel', 'referenceField' => 'serviceCategoryId', 'localField' => 'id', 'relation' => 'one_to_many', ]),
Expand Down
6 changes: 6 additions & 0 deletions src/Data/Entity/Category/CategoryEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ class CategoryEntity extends Entity

public ?bool $active = null;

public ?bool $cmsPageIdSwitched = null;

public ?int $visibleChildCount = null;

public ?string $name = null;

public ?array $slotConfig = null;
Expand Down Expand Up @@ -93,6 +97,8 @@ class CategoryEntity extends Entity

public ?ProductStreamEntity $productStream = null;

public ?string $customEntityTypeId = null;

public ?SalesChannelCollection $navigationSalesChannels = null;

public ?SalesChannelCollection $footerSalesChannels = null;
Expand Down
1 change: 1 addition & 0 deletions src/Data/Entity/CmsBlock/CmsBlockDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public function getSchema() : Schema
new Property('backgroundMediaId', 'uuid', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource', 'Shopware\Core\Framework\Api\Context\SalesChannelApiSource']]), ]), []),
new Property('backgroundMediaMode', 'string', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource', 'Shopware\Core\Framework\Api\Context\SalesChannelApiSource']]), ]), []),
new Property('cssClass', 'string', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource', 'Shopware\Core\Framework\Api\Context\SalesChannelApiSource']]), ]), []),
new Property('visibility', 'json_object', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource', 'Shopware\Core\Framework\Api\Context\SalesChannelApiSource']]), ]), ['properties' => json_decode('{"mobile":{"type":"boolean","flags":{"read_protected":[["Shopware\\Core\\Framework\\Api\\Context\\AdminApiSource"]]}},"desktop":{"type":"boolean","flags":{"read_protected":[["Shopware\\Core\\Framework\\Api\\Context\\AdminApiSource"]]}},"tablet":{"type":"boolean","flags":{"read_protected":[["Shopware\\Core\\Framework\\Api\\Context\\AdminApiSource"]]}}}', true), ]),
new Property('sectionId', 'uuid', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource', 'Shopware\Core\Framework\Api\Context\SalesChannelApiSource']]), new Flag('required', 1), ]), []),
new Property('section', 'association', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource']]), ]), ['entity' => 'cms_section', 'referenceField' => 'id', 'localField' => 'sectionId', 'relation' => 'many_to_one', ]),
new Property('backgroundMedia', 'association', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource', 'Shopware\Core\Framework\Api\Context\SalesChannelApiSource']]), ]), ['entity' => 'media', 'referenceField' => 'id', 'localField' => 'backgroundMediaId', 'relation' => 'many_to_one', ]),
Expand Down
2 changes: 2 additions & 0 deletions src/Data/Entity/CmsBlock/CmsBlockEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ class CmsBlockEntity extends Entity

public ?string $cssClass = null;

public ?array $visibility = null;

public ?string $sectionId = null;

public ?CmsSectionEntity $section = null;
Expand Down
1 change: 1 addition & 0 deletions src/Data/Entity/CmsSection/CmsSectionDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public function getSchema() : Schema
new Property('backgroundMediaMode', 'string', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource', 'Shopware\Core\Framework\Api\Context\SalesChannelApiSource']]), ]), []),
new Property('cssClass', 'string', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource', 'Shopware\Core\Framework\Api\Context\SalesChannelApiSource']]), ]), []),
new Property('pageId', 'uuid', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource', 'Shopware\Core\Framework\Api\Context\SalesChannelApiSource']]), new Flag('required', 1), ]), []),
new Property('visibility', 'json_object', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource', 'Shopware\Core\Framework\Api\Context\SalesChannelApiSource']]), ]), ['properties' => json_decode('{"mobile":{"type":"boolean","flags":{"read_protected":[["Shopware\\Core\\Framework\\Api\\Context\\AdminApiSource"]]}},"desktop":{"type":"boolean","flags":{"read_protected":[["Shopware\\Core\\Framework\\Api\\Context\\AdminApiSource"]]}},"tablet":{"type":"boolean","flags":{"read_protected":[["Shopware\\Core\\Framework\\Api\\Context\\AdminApiSource"]]}}}', true), ]),
new Property('page', 'association', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource', 'Shopware\Core\Framework\Api\Context\SalesChannelApiSource']]), ]), ['entity' => 'cms_page', 'referenceField' => 'id', 'localField' => 'pageId', 'relation' => 'many_to_one', ]),
new Property('backgroundMedia', 'association', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource', 'Shopware\Core\Framework\Api\Context\SalesChannelApiSource']]), ]), ['entity' => 'media', 'referenceField' => 'id', 'localField' => 'backgroundMediaId', 'relation' => 'many_to_one', ]),
new Property('blocks', 'association', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource', 'Shopware\Core\Framework\Api\Context\SalesChannelApiSource']]), new Flag('cascade_delete', 1), ]), ['entity' => 'cms_block', 'referenceField' => 'sectionId', 'localField' => 'id', 'relation' => 'one_to_many', ]),
Expand Down
2 changes: 2 additions & 0 deletions src/Data/Entity/CmsSection/CmsSectionEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class CmsSectionEntity extends Entity

public ?string $pageId = null;

public ?array $visibility = null;

public ?CmsPageEntity $page = null;

public ?MediaEntity $backgroundMedia = null;
Expand Down
1 change: 1 addition & 0 deletions src/Data/Entity/CmsSlot/CmsSlotDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public function getSchema() : Schema
new Property('blockId', 'uuid', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource', 'Shopware\Core\Framework\Api\Context\SalesChannelApiSource']]), new Flag('required', 1), ]), []),
new Property('block', 'association', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource', 'Shopware\Core\Framework\Api\Context\SalesChannelApiSource']]), ]), ['entity' => 'cms_block', 'referenceField' => 'id', 'localField' => 'blockId', 'relation' => 'many_to_one', ]),
new Property('translations', 'association', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource', 'Shopware\Core\Framework\Api\Context\SalesChannelApiSource']]), new Flag('cascade_delete', 1), ]), ['entity' => 'cms_slot_translation', 'referenceField' => 'cmsSlotId', 'localField' => 'id', 'relation' => 'one_to_many', ]),
new Property('fieldConfig', 'json_object', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource', 'Shopware\Core\Framework\Api\Context\SalesChannelApiSource']]), new Flag('runtime', 1), ]), []),
new Property('cmsBlockVersionId', 'uuid', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource', 'Shopware\Core\Framework\Api\Context\SalesChannelApiSource']]), new Flag('required', 1), ]), []),
new Property('createdAt', 'date', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource', 'Shopware\Core\Framework\Api\Context\SalesChannelApiSource']]), new Flag('required', 1), ]), []),
new Property('updatedAt', 'date', new FlagCollection([new Flag('read_protected', [['Shopware\Core\Framework\Api\Context\AdminApiSource', 'Shopware\Core\Framework\Api\Context\SalesChannelApiSource']]), ]), []),
Expand Down
2 changes: 2 additions & 0 deletions src/Data/Entity/CmsSlot/CmsSlotEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@ class CmsSlotEntity extends Entity

public ?CmsSlotTranslationCollection $translations = null;

public ?array $fieldConfig = null;

public ?string $cmsBlockVersionId = null;
}
Loading

0 comments on commit 3f163ef

Please sign in to comment.