/** * Sets the value of the specified property on this TenantObjectInstance. * @param unknown $property * @param unknown $value * @return boolean * @see TenantObjectInstanceProperty */ public function SetPropertyValue($property, $value) { global $MySQL; if (is_string($property)) { $property = $this->ParentObject->GetInstanceProperty($property); } if ($property == null) { return false; } $query = "INSERT INTO " . System::$Configuration["Database.TablePrefix"] . "TenantObjectInstancePropertyValues (propval_InstanceID, propval_PropertyID, propval_Value) VALUES ("; $query .= $this->ID . ", "; $query .= $property->ID . ", "; $query .= "'" . $MySQL->real_escape_string($property->Encode($value)) . "'"; $query .= ")"; $query .= " ON DUPLICATE KEY UPDATE "; $query .= "propval_PropertyID = values(propval_PropertyID), "; $query .= "propval_Value = values(propval_Value)"; $result = $MySQL->query($query); if ($result === false) { return false; } return true; }