getPropertyValue() public method

Gets the value for the current property, converts to applicable type if necessary.
public getPropertyValue ( $registry, $row ) : mixed
return mixed property value.
Exemplo 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;
 }