original_string: protected function _dataToSerialize($serialize, $additionalData = []) {
  		if ($serialize === true) {
  			$data = array_diff_key(
  				$this->viewVars,
  				array_flip($this->_specialVars)
  			);
  			return $data;
  		}
  
  		foreach ((array)$serialize as $alias => $key) {
  			if (is_numeric($alias)) {
  				$alias = $key;
  			}
  			if (array_key_exists($key, $this->viewVars)) {
  				$additionalData[$alias] = $this->viewVars[$key];
  			}
  		}
  		return $additionalData;
  	}
code: protected function _dataToSerialize($serialize, $additionalData = []) {
  		if ($serialize === true) {
  			$data = array_diff_key(
  				$this->viewVars,
  				array_flip($this->_specialVars)
  			);
  			return $data;
  		}
  
  		foreach ((array)$serialize as $alias => $key) {
  			if (is_numeric($alias)) {
  				$alias = $key;
  			}
  			if (array_key_exists($key, $this->viewVars)) {
  				$additionalData[$alias] = $this->viewVars[$key];
  			}
  		}
  		return $additionalData;
  	}
code_tokens: protected function _dataToSerialize ( $ serialize , $ additionalData = [ ] ) { if ( $ serialize === true ) { $ data = array_diff_key ( $ this -> viewVars , array_flip ( $ this -> _specialVars ) ) ; return $ data ; } foreach ( ( array ) $ serialize as $ alias => $ key ) { if ( is_numeric ( $ alias ) ) { $ alias = $ key ; } if ( array_key_exists ( $ key , $ this -> viewVars ) ) { $ additionalData [ $ alias ] = $ this -> viewVars [ $ key ] ; } } return $ additionalData ; }
docstring: Returns data to be serialized based on the value of viewVars.
  
  @param array|string|bool $serialize The name(s) of the view variable(s) that
  need(s) to be serialized. If true all available view variables will be used.
  @param array $additionalData Data items that were defined internally in our own
  render method.
  @return mixed The data to serialize.
docstring_tokens: Returns data to be serialized based on the value of viewVars .