⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.45
Server IP:
185.238.29.86
Server:
Linux server2 6.8.12-6-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-6 (2024-12-19T19:05Z) x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.31
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
www
/
shopware
/
vendor
/
shopware
/
core
/
System
/
Tax
/
Edit File: TaxDefinition.php
<?php declare(strict_types=1); namespace Shopware\Core\System\Tax; use Shopware\Core\Checkout\Shipping\ShippingMethodDefinition; use Shopware\Core\Content\Product\ProductDefinition; use Shopware\Core\Framework\DataAbstractionLayer\EntityDefinition; use Shopware\Core\Framework\DataAbstractionLayer\Field\CustomFields; use Shopware\Core\Framework\DataAbstractionLayer\Field\Flag\ApiAware; use Shopware\Core\Framework\DataAbstractionLayer\Field\Flag\PrimaryKey; use Shopware\Core\Framework\DataAbstractionLayer\Field\Flag\Required; use Shopware\Core\Framework\DataAbstractionLayer\Field\Flag\RestrictDelete; use Shopware\Core\Framework\DataAbstractionLayer\Field\Flag\ReverseInherited; use Shopware\Core\Framework\DataAbstractionLayer\Field\Flag\SearchRanking; use Shopware\Core\Framework\DataAbstractionLayer\Field\Flag\Since; use Shopware\Core\Framework\DataAbstractionLayer\Field\FloatField; use Shopware\Core\Framework\DataAbstractionLayer\Field\IdField; use Shopware\Core\Framework\DataAbstractionLayer\Field\IntField; use Shopware\Core\Framework\DataAbstractionLayer\Field\OneToManyAssociationField; use Shopware\Core\Framework\DataAbstractionLayer\Field\StringField; use Shopware\Core\Framework\DataAbstractionLayer\FieldCollection; use Shopware\Core\Framework\Log\Package; use Shopware\Core\System\Tax\Aggregate\TaxRule\TaxRuleDefinition; #[Package('customer-order')] class TaxDefinition extends EntityDefinition { public const ENTITY_NAME = 'tax'; public function getEntityName(): string { return self::ENTITY_NAME; } public function getCollectionClass(): string { return TaxCollection::class; } public function getEntityClass(): string { return TaxEntity::class; } public function since(): ?string { return '6.0.0.0'; } public function getDefaults(): array { return [ 'position' => 0, ]; } protected function defineFields(): FieldCollection { return new FieldCollection([ (new IdField('id', 'id'))->addFlags(new ApiAware(), new PrimaryKey(), new Required()), (new FloatField('tax_rate', 'taxRate'))->addFlags(new ApiAware(), new Required(), new SearchRanking(SearchRanking::HIGH_SEARCH_RANKING)), (new StringField('name', 'name'))->addFlags(new ApiAware(), new Required(), new SearchRanking(SearchRanking::HIGH_SEARCH_RANKING)), (new IntField('position', 'position'))->addFlags(new Required(), new Since('6.4.0.0'), new ApiAware()), (new CustomFields())->addFlags(new ApiAware()), (new OneToManyAssociationField('products', ProductDefinition::class, 'tax_id', 'id'))->addFlags(new RestrictDelete(), new ReverseInherited('tax')), (new OneToManyAssociationField('rules', TaxRuleDefinition::class, 'tax_id', 'id'))->addFlags(new RestrictDelete()), (new OneToManyAssociationField('shippingMethods', ShippingMethodDefinition::class, 'tax_id', 'id'))->addFlags(new RestrictDelete()), ]); } }
Simpan