vendor/shopware/core/Content/Product/Aggregate/ProductManufacturer/ProductManufacturerHydrator.php line 15

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Shopware\Core\Content\Product\Aggregate\ProductManufacturer;
  3. use Shopware\Core\Framework\Context;
  4. use Shopware\Core\Framework\DataAbstractionLayer\Dbal\EntityHydrator;
  5. use Shopware\Core\Framework\DataAbstractionLayer\Entity;
  6. use Shopware\Core\Framework\DataAbstractionLayer\EntityDefinition;
  7. use Shopware\Core\Framework\Log\Package;
  8. use Shopware\Core\Framework\Uuid\Uuid;
  9. #[Package('inventory')]
  10. class ProductManufacturerHydrator extends EntityHydrator
  11. {
  12.     protected function assign(EntityDefinition $definitionEntity $entitystring $root, array $rowContext $context): Entity
  13.     {
  14.         if (isset($row[$root '.id'])) {
  15.             $entity->id Uuid::fromBytesToHex($row[$root '.id']);
  16.         }
  17.         if (isset($row[$root '.versionId'])) {
  18.             $entity->versionId Uuid::fromBytesToHex($row[$root '.versionId']);
  19.         }
  20.         if (isset($row[$root '.mediaId'])) {
  21.             $entity->mediaId Uuid::fromBytesToHex($row[$root '.mediaId']);
  22.         }
  23.         if (isset($row[$root '.link'])) {
  24.             $entity->link $row[$root '.link'];
  25.         }
  26.         if (isset($row[$root '.createdAt'])) {
  27.             $entity->createdAt = new \DateTimeImmutable($row[$root '.createdAt']);
  28.         }
  29.         if (isset($row[$root '.updatedAt'])) {
  30.             $entity->updatedAt = new \DateTimeImmutable($row[$root '.updatedAt']);
  31.         }
  32.         $entity->media $this->manyToOne($row$root$definition->getField('media'), $context);
  33.         $this->translate($definition$entity$row$root$context$definition->getTranslatedFields());
  34.         $this->hydrateFields($definition$entity$root$row$context$definition->getExtensionFields());
  35.         $this->customFields($definition$row$root$entity$definition->getField('customFields'), $context);
  36.         return $entity;
  37.     }
  38. }