public function addFields($fields = [], $defaults = [])
    {
        foreach ($fields as $field) {
            if (is_string($field)) {
                $this->addField($field, $defaults);
                continue;
            }

            if (is_array($field) && isset($field[0])) {
                $name = $field[0];
                unset($field[0]);
                $this->addField($name, $field);
                continue;
            }
        }

        return $this;
    }
public function addFields($fields = [], $defaults = [])
    {
        foreach ($fields as $field) {
            if (is_string($field)) {
                $this->addField($field, $defaults);
                continue;
            }

            if (is_array($field) && isset($field[0])) {
                $name = $field[0];
                unset($field[0]);
                $this->addField($name, $field);
                continue;
            }
        }

        return $this;
    }
public function addFields ( $ fields = [ ] , $ defaults = [ ] ) { foreach ( $ fields as $ field ) { if ( is_string ( $ field ) ) { $ this -> addField ( $ field , $ defaults ) ; continue ; } if ( is_array ( $ field ) && isset ( $ field [ 0 ] ) ) { $ name = $ field [ 0 ] ; unset ( $ field [ 0 ] ) ; $ this -> addField ( $ name , $ field ) ; continue ; } } return $ this ; }
Adds multiple fields into model.

@param array $fields
@param array $defaults

@return $this
Adds multiple fields into model .