public function item($model, array $data = [], array $options = []) {
		$defaults = ['class' => 'entity'];
		$options += $defaults;

		if ($options['class'] === 'entity') {
			return $model::create($this->_format($data), $options);
		}

		foreach ($data as $key => $value) {
			if (isset($value['doc'])) {
				$value = $value['doc'];
			}
			if (isset($value['value'])) {
				$value = $value['value'];
			}
			$data[$key] = $this->_format($value);
		}
		return $model::create($data, $options);
	}
public function item($model, array $data = [], array $options = []) {
		$defaults = ['class' => 'entity'];
		$options += $defaults;

		if ($options['class'] === 'entity') {
			return $model::create($this->_format($data), $options);
		}

		foreach ($data as $key => $value) {
			if (isset($value['doc'])) {
				$value = $value['doc'];
			}
			if (isset($value['value'])) {
				$value = $value['value'];
			}
			$data[$key] = $this->_format($value);
		}
		return $model::create($data, $options);
	}
public function item ( $ model , array $ data = [ ] , array $ options = [ ] ) { $ defaults = [ 'class' => 'entity' ] ; $ options += $ defaults ; if ( $ options [ 'class' ] === 'entity' ) { return $ model :: create ( $ this -> _format ( $ data ) , $ options ) ; } foreach ( $ data as $ key => $ value ) { if ( isset ( $ value [ 'doc' ] ) ) { $ value = $ value [ 'doc' ] ; } if ( isset ( $ value [ 'value' ] ) ) { $ value = $ value [ 'value' ] ; } $ data [ $ key ] = $ this -> _format ( $ value ) ; } return $ model :: create ( $ data , $ options ) ; }
Returns a newly-created `Document` object, bound to a model and populated with default data
and options.

@param string $model A fully-namespaced class name representing the model class to which the
`Document` object will be bound.
@param array $data The default data with which the new `Document` should be populated.
@param array $options Any additional options to pass to the `Document`'s constructor
@return object Returns a new, un-saved `Document` object bound to the model class specified
in `$model`.
Returns a newly - created Document object bound to a model and populated with default data and options .