vendor/shopware/core/System/Tax/Aggregate/TaxRule/TaxRuleCollection.php line 12

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Shopware\Core\System\Tax\Aggregate\TaxRule;
  3. use Shopware\Core\Framework\DataAbstractionLayer\EntityCollection;
  4. use Shopware\Core\Framework\Log\Package;
  5. /**
  6.  * @extends EntityCollection<TaxRuleEntity>
  7.  */
  8. #[Package('customer-order')]
  9. class TaxRuleCollection extends EntityCollection
  10. {
  11.     public function sortByTypePosition(): void
  12.     {
  13.         $this->sort(function (TaxRuleEntity $entityATaxRuleEntity $entityB) {
  14.             return $entityA->getType()->getPosition() <=> $entityB->getType()->getPosition();
  15.         });
  16.     }
  17.     public function getApiAlias(): string
  18.     {
  19.         return 'tax_rule_collection';
  20.     }
  21.     protected function getExpectedClass(): string
  22.     {
  23.         return TaxRuleEntity::class;
  24.     }
  25. }