public function add($name, $value = null)
    {
        if (is_array($value)) {
            $this->addRecursive($name, $value);
        } elseif (is_resource($value)) {
            $this->addFile($name, $value);
        } elseif ($name instanceof FormDataPart && $value === null) {
            $this->_hasComplexPart = true;
            $this->_parts[] = $name;
        } else {
            $this->_parts[] = $this->newPart($name, $value);
        }

        return $this;
    }
public function add($name, $value = null)
    {
        if (is_array($value)) {
            $this->addRecursive($name, $value);
        } elseif (is_resource($value)) {
            $this->addFile($name, $value);
        } elseif ($name instanceof FormDataPart && $value === null) {
            $this->_hasComplexPart = true;
            $this->_parts[] = $name;
        } else {
            $this->_parts[] = $this->newPart($name, $value);
        }

        return $this;
    }
public function add ( $ name , $ value = null ) { if ( is_array ( $ value ) ) { $ this -> addRecursive ( $ name , $ value ) ; } elseif ( is_resource ( $ value ) ) { $ this -> addFile ( $ name , $ value ) ; } elseif ( $ name instanceof FormDataPart && $ value === null ) { $ this -> _hasComplexPart = true ; $ this -> _parts [ ] = $ name ; } else { $ this -> _parts [ ] = $ this -> newPart ( $ name , $ value ) ; } return $ this ; }
Add a new part to the data.

The value for a part can be a string, array, int,
float, filehandle, or object implementing __toString()

If the $value is an array, multiple parts will be added.
Files will be read from their current position and saved in memory.

@param string|\Cake\Http\Client\FormData $name The name of the part to add,
or the part data object.
@param mixed $value The value for the part.
@return $this
Add a new part to the data .