protected function parseFields($fields, $name) {
		if(is_array($fields)) {
			return new self(
				$fields,
				$name,
				(isset($this->data[$name]) ? $this->data[$name]:[]),
				$this
			);
		}
		elseif($fields instanceof Field) {
			$field = $fields;
			$field->setName($name);
			$field->setParent($this);

			if(isset($this->data[$name]))
				$field->setValue($this->data[$name]);

			return $field;
		}
		elseif($fields instanceof self) {
			$group = $fields;
			$group->setName($name);
			$group->setParent($this);
			$group->setData(
				(isset($this->data[$name]) ? $this->data[$name]:[])
			);

			return $group;
		}
	}
protected function parseFields($fields, $name) {
		if(is_array($fields)) {
			return new self(
				$fields,
				$name,
				(isset($this->data[$name]) ? $this->data[$name]:[]),
				$this
			);
		}
		elseif($fields instanceof Field) {
			$field = $fields;
			$field->setName($name);
			$field->setParent($this);

			if(isset($this->data[$name]))
				$field->setValue($this->data[$name]);

			return $field;
		}
		elseif($fields instanceof self) {
			$group = $fields;
			$group->setName($name);
			$group->setParent($this);
			$group->setData(
				(isset($this->data[$name]) ? $this->data[$name]:[])
			);

			return $group;
		}
	}
protected function parseFields ( $ fields , $ name ) { if ( is_array ( $ fields ) ) { return new self ( $ fields , $ name , ( isset ( $ this -> data [ $ name ] ) ? $ this -> data [ $ name ] : [ ] ) , $ this ) ; } elseif ( $ fields instanceof Field ) { $ field = $ fields ; $ field -> setName ( $ name ) ; $ field -> setParent ( $ this ) ; if ( isset ( $ this -> data [ $ name ] ) ) $ field -> setValue ( $ this -> data [ $ name ] ) ; return $ field ; } elseif ( $ fields instanceof self ) { $ group = $ fields ; $ group -> setName ( $ name ) ; $ group -> setParent ( $ this ) ; $ group -> setData ( ( isset ( $ this -> data [ $ name ] ) ? $ this -> data [ $ name ] : [ ] ) ) ; return $ group ; } }
Parse new fields.
@param  array|Field|GroupInterface $fields
@param  string $name
@return GroupInterface|Field
Parse new fields .