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 outgoing null value replacement. What this means is that when a null value is detected in the result, the corresponding value of the {@link NullValue getNullValue()} will be used instead. The {@link Select setSelect()} property is used to describe a relationship between objects and to automatically load complex (i.e. user defined) property types. The value of the {@link Select setSelect()} property must be the name of another mapped statement. The value of the database {@link Column setColumn()} that is defined in the same property element as this statement attribute will be passed to the related mapped statement as the parameter. The {@link LazyLoad setLayLoad()} attribute can be specified with the {@link Select setSelect()} .
Since: 3.1
Inheritance: extends Prado\TComponent
Ejemplo n.º 1
0
 /**
  * Apply the result to an object.
  * @param array a result set row retrieved from the database
  * @param object result object, array or list
  * @return object result filled with data.
  */
 protected function fillResultObjectProperty($row, $resultObject)
 {
     $index = 0;
     $registry = $this->getManager()->getTypeHandlers();
     foreach ($row as $k => $v) {
         $property = new TResultProperty();
         if (is_string($k) && strlen($k) > 0) {
             $property->setColumn($k);
         }
         $property->setColumnIndex(++$index);
         $type = gettype(TPropertyAccess::get($resultObject, $k));
         $property->setType($type);
         $value = $property->getPropertyValue($registry, $row);
         TPropertyAccess::set($resultObject, $k, $value);
     }
     return $resultObject;
 }
Ejemplo n.º 2
0
 /**
  * Add a TResultProperty to result mapping.
  * @param TResultProperty result property.
  */
 public function addResultProperty(TResultProperty $property)
 {
     $this->_columns[$property->getProperty()] = $property;
 }