public function update(Model $m, $id, $data, $table = null)
    {
        if (!isset($table)) {
            $table = $m->table;
        }

        $data = $this->typecastSaveRow($m, $data);

        $this->data[$table][$id] =
            array_merge(
                isset($this->data[$table][$id]) ? $this->data[$table][$id] : [],
                $data
            );

        return $id;
    }
public function update(Model $m, $id, $data, $table = null)
    {
        if (!isset($table)) {
            $table = $m->table;
        }

        $data = $this->typecastSaveRow($m, $data);

        $this->data[$table][$id] =
            array_merge(
                isset($this->data[$table][$id]) ? $this->data[$table][$id] : [],
                $data
            );

        return $id;
    }
public function update ( Model $ m , $ id , $ data , $ table = null ) { if ( ! isset ( $ table ) ) { $ table = $ m -> table ; } $ data = $ this -> typecastSaveRow ( $ m , $ data ) ; $ this -> data [ $ table ] [ $ id ] = array_merge ( isset ( $ this -> data [ $ table ] [ $ id ] ) ? $ this -> data [ $ table ] [ $ id ] : [ ] , $ data ) ; return $ id ; }
Updates record in data array and returns record ID.

@param Model  $m
@param mixed  $id
@param array  $data
@param string $table

@return mixed
Updates record in data array and returns record ID .