コード例 #1
0
ファイル: ParseObject.php プロジェクト: uday21/order
 /**
  * Perform an operation on an object property.
  *
  * @param string         $key       Key to perform an operation upon.
  * @param FieldOperation $operation Operation to perform.
  *
  * @return null
  * @ignore
  */
 public function _performOperation($key, FieldOperation $operation)
 {
     $oldValue = null;
     if (isset($this->estimatedData[$key])) {
         $oldValue = $this->estimatedData[$key];
     }
     $newValue = $operation->_apply($oldValue, $this, $key);
     if ($newValue !== null) {
         $this->estimatedData[$key] = $newValue;
     } else {
         if (isset($this->estimatedData[$key])) {
             unset($this->estimatedData[$key]);
         }
     }
     if (isset($this->operationSet[$key])) {
         $oldOperations = $this->operationSet[$key];
         $newOperations = $operation->_mergeWithPrevious($oldOperations);
         $this->operationSet[$key] = $newOperations;
     } else {
         $this->operationSet[$key] = $operation;
     }
     $this->dataAvailability[$key] = true;
 }