/**
  * Helper to form a value, given JSON decoded data
  * The operation is the opposite to GetForJSON	 
  */
 public function FromJSONToValue($json)
 {
     if (is_string($json)) {
         // Will be correctly handled in MakeRealValue
         $ret = $json;
     } else {
         if (isset($json->add_item)) {
             // Will be correctly handled in MakeRealValue
             $ret = $json->add_item;
             if (!isset($ret->message)) {
                 throw new Exception("Missing mandatory entry: 'message'");
             }
         } else {
             $ret = ormCaseLog::FromJSON($json);
         }
     }
     return $ret;
 }