public final function ToPersistedValue($PropertyValue)
{
if ($PropertyValue === null) {
return null;
}
if (!$PropertyValue instanceof $this->ClassType) {
throw new DataTypeException('Invalid property value for %s: expecting %s, %s given', get_class($this), $this->ClassType, \Storm\Core\Utilities::GetTypeOrClass($PropertyValue));
}
return $this->PersistedValue($PropertyValue);
}