The {@link NullValue setNullValue()} attribute can be set to any valid value (based on property type). The {@link NullValue setNullValue()} attribute is used to specify an inbound null value replacement. What this means is that when the value is detected in the object property, a NULL will be written to the database (the opposite behavior of an inbound null value replacement). This allows you to use a magic null number in your application for types that do not support null values (such as int, double, float). When these types of properties contain a matching null value (for example, say, -9999), a NULL will be written to the database instead of the value.
С версии: 3.1
Наследование: extends Prado\TComponent
Пример #1
0
 /**
  * Parse inline parameter with syntax as
  * #propertyName,type=string,dbype=Varchar,nullValue=N/A,handler=string#
  * @param string parameter token
  * @param array file and node details for exception message.
  */
 protected function parseMapping($token, $scope)
 {
     $mapping = new TParameterProperty();
     $properties = explode(',', $token);
     $mapping->setProperty(trim(array_shift($properties)));
     foreach ($properties as $property) {
         $prop = explode('=', $property);
         $name = trim($prop[0]);
         $value = trim($prop[1]);
         if ($mapping->canSetProperty($name)) {
             $mapping->{'set' . $name}($value);
         } else {
             throw new TSqlMapUndefinedException('sqlmap_undefined_property_inline_map', $name, $scope['file'], $scope['node'], $token);
         }
     }
     return $mapping;
 }