/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
lib/internal/Magento/Framework/EntityManager/Operation/Update/UpdateAttributes.php
64 строки
2 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 17:47
22 окт 2025, 17:47
1b769b7
Код
Авторство
О чём код?
<?php /** * Copyright 2016 Adobe * All Rights Reserved. */ namespace Magento\Framework\EntityManager\Operation\Update; use Magento\Framework\EntityManager\TypeResolver; use Magento\Framework\EntityManager\HydratorPool; use Magento\Framework\EntityManager\Operation\AttributePool; /** * Class UpdateAttributes */ class UpdateAttributes { /** * @var TypeResolver */ private $typeResolver; /** * @var HydratorPool */ private $hydratorPool; /** * @var AttributePool */ private $attributePool; /** * @param TypeResolver $typeResolver * @param HydratorPool $hydratorPool * @param AttributePool $attributePool */ public function __construct( TypeResolver $typeResolver, HydratorPool $hydratorPool, AttributePool $attributePool ) { $this->typeResolver = $typeResolver; $this->hydratorPool = $hydratorPool; $this->attributePool = $attributePool; } /** * @param object $entity * @param array $arguments * @return object */ public function execute($entity, $arguments = []) { $entityType = $this->typeResolver->resolve($entity); $hydrator = $this->hydratorPool->getHydrator($entityType); $entityData = array_merge($hydrator->extract($entity), $arguments); $actions = $this->attributePool->getActions($entityType, 'update'); foreach ($actions as $action) { $entityData = $action->execute($entityType, $entityData, $arguments); } $entity = $hydrator->hydrate($entity, $entityData); return $entity; } }