Sets the data to be sent as json.

@param mixed $data
175377
public function setData($data)
    {
        // Encode <, >, ', &, and " for RFC4627-compliant JSON, which may also be embedded into HTML.
        $this->data = json_encode($data, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT);
    }
1159660
private function convertToJson($data)
    {
        if (is_array($data)) {
            return json_encode($data);
        }

        if ($data instanceof Jsonable) {
            return $data->toJson();
        }

        if ($data instanceof Arrayable) {
            return json_encode($data->toArray());
        }

        return null;
    }
830840
public static function jsonEncode($data)
    {
        $json = json_encode($data);
        // if json_encode failed
        if ($json === false) {
            self::jsonLastError();
        }
        return $json;
    }
819271
public function makeFromJSON(string $data): \BearFramework\Emails\Email
    {
        return \BearFramework\Emails\Email::fromJSON($data);
    }
1159353
public function setData($data)
    {
        $body = new Doozr_Response_Body();
        $body->write($data);

        $this->setBody($body);
    }
596407
public function withJsonBody($data, SerializationContext $context = null)
    {
        if (is_string($data)) {
            $json = $data;
        } else {
            $json = SerializerBuilder::create()->build()->serialize($data, 'json', $context);
        }
        $this->withBody($json);

        return $this;
    }
1166199
public function set_data( $data ) {
		if ( isset( $data[ $this->slug ] ) ) {
			if ( is_string( $data[ $this->slug ] ) ) {
				$is_json = json_decode( $data[ $this->slug ], ARRAY_A );
				if ( ! empty( $is_json ) ) {
					$data[ $this->slug ] = $is_json;
				} else {
					$data[ $this->slug ] = str_replace( '{{@root', '{{json @root', $data[ $this->slug ] );
				}
			}
			$this->data[ $this->id() ][ $this->slug ] = apply_filters( 'uix_' . $this->slug . '_sanitize_' . $this->type, $data[ $this->slug ], $this );
		}

	}
853177
public function setData($data = array())
    {
        

    	//empty local data
    	$this->rows = array();
    	//fill the local data
		foreach($data as $rowId => $cells){
			if(is_array($cells)){
				$this->addRow($rowId, $cells);
			}else if(is_string($cells)){
				$this->addRow($cells);
			}
		}

        
    }
1046281
public function setData($data)
    {
        $this->data = $data;

        if (is_string($this->data)) {
            $this->data = json_decode($this->data, true);
        } else if (is_object($data)) {
            $this->data = json_decode(json_encode($this->data), true);
        } else if (!is_array($data)) {
            throw new \InvalidArgumentException(sprintf('Invalid data type in JsonStore. Expected object, array or string, got %s', gettype($data)));
        }
    }
600980
protected function jsonEncode(array $data)
    {
        set_error_handler(function () {
            $this->handleJsonError(JSON_ERROR_SYNTAX);
        }, E_WARNING);
        
        $json = json_encode($data, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT);
        restore_error_handler();
        $this->handleJsonError(json_last_error());
        
        return $json;
    }
911039
public function setData($data = [])
    {
        if (!is_array($data) && is_string($data)) {
            $data = parse_str($data);
        }
        if (count($data) == 0) {
            $this->data = [];
        } else {
            $this->data = $data;
        }
        $this->debug->debug(__FUNCTION__, 'Data into Request: ', $this->data);
    }
699284
private function _toJson($data)
    {
        if ($data) {
            if (is_array($data)) {
                return json_encode($this->_toCleanArray($data));
            }

            return json_encode($data);
        }
    }
1173644
protected function _jsonEncode($data)
    {
        return is_string($data) ? $data : json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . PHP_EOL;
    }
192592
public function setResponseBody($data)
    {
        if (!is_string($data)) {
            $data = json_encode($data, \JSON_PRETTY_PRINT);
        }
        $this->response->getBody()->write($data);
        return $this;
    }
1242377
public function setJsonBody($data)
    {
        $body = json_encode($data, JSON_UNESCAPED_UNICODE);
        $this->setHeader('content-type', 'application/json');
        $this->setBody($body);
    }
1225729
public function putJSON($url, $data)
    {
        $responseBody = $this->put($url, json_encode($data), 'application/json');

        return json_decode($responseBody);
    }
528932
private function setData($data) {

		if(false === is_array($data)) {
   			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type array, "%s" given', __METHOD__, gettype($data)), E_USER_ERROR);
   		}

		$this -> data = $data;
	}