operationResource = $operationResource; } /** * @inheritDoc */ public function execute(array $operations): void { try { $operationsToInsert = array_map(function ($operation) { return $operation->getData(); }, $operations); $connection = $this->operationResource->getConnection(); $connection->insertMultiple( $this->operationResource->getTable(OperationResource::TABLE_NAME), $operationsToInsert ); } catch (\Exception $exception) { throw new CouldNotSaveException(__($exception->getMessage())); } } }