public function typecastLoadRow(Model $m, $row)
    {
        if (!$row) {
            return $row;
        }

        $result = [];
        foreach ($row as $key => &$value) {

            // Look up field object
            $f = $m->hasField($key);

            // We have no knowledge of the field, it wasn't defined, so
            // we will leave it as-is.
            if (!$f) {
                $result[$key] = $value;
                continue;
            }

            // ignore null values
            if ($value === null) {
                $result[$key] = $value;
                continue;
            }

            // serialize if we explicitly want that
            if ($f->serialize) {
                $value = $this->serializeLoadField($f, $value);
            }

            // typecast if we explicitly want that or there is not serialization enabled
            if ($f->typecast || ($f->typecast === null && $f->serialize === null)) {
                $value = $this->typecastLoadField($f, $value);
            }

            // store converted value
            $result[$key] = $value;
        }

        return $result;
    }
public function typecastLoadRow(Model $m, $row)
    {
        if (!$row) {
            return $row;
        }

        $result = [];
        foreach ($row as $key => &$value) {

            // Look up field object
            $f = $m->hasField($key);

            // We have no knowledge of the field, it wasn't defined, so
            // we will leave it as-is.
            if (!$f) {
                $result[$key] = $value;
                continue;
            }

            // ignore null values
            if ($value === null) {
                $result[$key] = $value;
                continue;
            }

            // serialize if we explicitly want that
            if ($f->serialize) {
                $value = $this->serializeLoadField($f, $value);
            }

            // typecast if we explicitly want that or there is not serialization enabled
            if ($f->typecast || ($f->typecast === null && $f->serialize === null)) {
                $value = $this->typecastLoadField($f, $value);
            }

            // store converted value
            $result[$key] = $value;
        }

        return $result;
    }
public function typecastLoadRow ( Model $ m , $ row ) { if ( ! $ row ) { return $ row ; } $ result = [ ] ; foreach ( $ row as $ key => & $ value ) { // Look up field object $ f = $ m -> hasField ( $ key ) ; // We have no knowledge of the field, it wasn't defined, so // we will leave it as-is. if ( ! $ f ) { $ result [ $ key ] = $ value ; continue ; } // ignore null values if ( $ value === null ) { $ result [ $ key ] = $ value ; continue ; } // serialize if we explicitly want that if ( $ f -> serialize ) { $ value = $ this -> serializeLoadField ( $ f , $ value ) ; } // typecast if we explicitly want that or there is not serialization enabled if ( $ f -> typecast || ( $ f -> typecast === null && $ f -> serialize === null ) ) { $ value = $ this -> typecastLoadField ( $ f , $ value ) ; } // store converted value $ result [ $ key ] = $ value ; } return $ result ; }
Will convert one row of data from Persistence-specific
types to PHP native types.

NOTE: Please DO NOT perform "actual" field mapping here, because data
may be "aliased" from SQL persistences or mapped depending on persistence
driver.

@param Model $m
@param array $row

@return array
Will convert one row of data from Persistence - specific types to PHP native types .