public function sync($id = null, array $data = [], array $options = []) {
		$defaults = ['recursive' => true];
		$options += $defaults;

		if (!$options['recursive']) {
			return parent::sync($id, $data, $options);
		}

		foreach ($this->_updated as $key => $val) {
			if (is_object($val) && method_exists($val, 'sync')) {
				$nested = isset($data[$key]) ? $data[$key] : [];
				$this->_updated[$key]->sync(null, $nested, $options);
			}
		}
		parent::sync($id, $data, $options);
	}
public function sync($id = null, array $data = [], array $options = []) {
		$defaults = ['recursive' => true];
		$options += $defaults;

		if (!$options['recursive']) {
			return parent::sync($id, $data, $options);
		}

		foreach ($this->_updated as $key => $val) {
			if (is_object($val) && method_exists($val, 'sync')) {
				$nested = isset($data[$key]) ? $data[$key] : [];
				$this->_updated[$key]->sync(null, $nested, $options);
			}
		}
		parent::sync($id, $data, $options);
	}
public function sync ( $ id = null , array $ data = [ ] , array $ options = [ ] ) { $ defaults = [ 'recursive' => true ] ; $ options += $ defaults ; if ( ! $ options [ 'recursive' ] ) { return parent :: sync ( $ id , $ data , $ options ) ; } foreach ( $ this -> _updated as $ key => $ val ) { if ( is_object ( $ val ) && method_exists ( $ val , 'sync' ) ) { $ nested = isset ( $ data [ $ key ] ) ? $ data [ $ key ] : [ ] ; $ this -> _updated [ $ key ] -> sync ( null , $ nested , $ options ) ; } } parent :: sync ( $ id , $ data , $ options ) ; }
Extends the parent implementation to ensure that child documents are properly synced as well.

@param mixed $id
@param array $data
@param array $options Options when calling this method:
- `'recursive'` _boolean_: If `true` attempts to sync nested objects as well.
Otherwise, only syncs the current object. Defaults to `true`.
@return void
Extends the parent implementation to ensure that child documents are properly synced as well .