public function assign($vals)
    {
        if (count($vals) === 0) {
            return 0;
        }

        $n = 0;
        foreach ($vals as $k => $v) {
            if ($this->set($k, $v)) {
                $n++;
            }
        }

        return $n;
    }
public function assign($vals)
    {
        if (count($vals) === 0) {
            return 0;
        }

        $n = 0;
        foreach ($vals as $k => $v) {
            if ($this->set($k, $v)) {
                $n++;
            }
        }

        return $n;
    }
public function assign ( $ vals ) { if ( count ( $ vals ) === 0 ) { return 0 ; } $ n = 0 ; foreach ( $ vals as $ k => $ v ) { if ( $ this -> set ( $ k , $ v ) ) { $ n ++ ; } } return $ n ; }
Set multiple fields
@param array
@return integer Number of fields assigned
Set multiple fields