/** * Construct SaveResult * * @param ObjectContext $context * @param SaveChangesOption $saveChangesOptions */ public function SaveResult($context, $saveChangesOptions) { $this->_context = $context; $mergedDictionary = Dictionary::Merge($this->_context->ObjectToResource, $this->_context->Bindings, "State", Entitystates::Unchanged, FALSE); $mergedDictionary->Sort("ChangeOrder"); $this->_changedEntries = $mergedDictionary->Values(); $this->_batchBoundary = "batch_" . Guid::NewGuid(); $this->_completed = false; $this->_entryIndex = -1; $this->_processingMediaLinkEntry = false; $this->_processingMediaLinkEntryPut = false; $this->_mediaResourceRequestStream = null; $this->_operationResponses = array(); $this->_changeOrderIDToHttpStatus = array(); if ($saveChangesOptions == SaveChangesOptions::None) { //If savechange option is non-batch mode then we should retrive all //MLE resource boxes with state 'Unchanged' and Stream not equal to //null and add it to $this->_changedEntries. $entries = $this->_context->ObjectToResource->Values(); foreach ($entries as $entry) { if ($entry->State == EntityStates::Unchanged && $entry->SaveStream != null) { $this->_changedEntries[] = $entry; } } } }