/** * Register snapshot of entity data, for tracking changes * * @param \Magento\Framework\DataObject $entity * @return void * @SuppressWarnings(PHPMD.UnusedLocalVariable) */ public function registerSnapshot(\Magento\Framework\DataObject $entity) { $metaData = $this->metadata->getFields($entity); $filteredData = array_intersect_key($entity->getData(), $metaData); $data = array_merge($metaData, $filteredData); $this->snapshotData[get_class($entity)][$entity->getId()] = $data; }