@param string|array $json

@return \DevGroup\DataStructure\search\base\SearchQuery
337558
public function searchFromJson($json)
    {
        if (is_string($json)) {
            $json = yii\helpers\Json::decode($json);
        }
        if (isset($json['mainEntityClassName'], $json['searchQuery']) === false) {
            throw new \RuntimeException("mainEntityClassName and searchQuery needed to be in json for search");
        }
        $mainEntityClassName = $json['mainEntityClassName'];
        $q = new SearchQuery($mainEntityClassName, $this, $json['searchQuery']);
        $q->pagination($q->pagination);
        return $q;
    }
1254185
public static function load($json)
    {
        $j = new Json();

        return self::create($j->decode($json), $j);
    }
186328
public static function fromJson($json)
    {
        $responseData = json_decode($json, true);

        if (! $responseData) {
            return new Response(false, ['invalid-json']);
        }

        if (isset($responseData['success']) && $responseData['success'] == true) {
            return new Response(true);
        }

        if (isset($responseData['error-codes']) && is_array($responseData['error-codes'])) {
            return new Response(false, $responseData['error-codes']);
        }

        return new Response(false);
    }
326961
public static function convertFromJSON($json)
    {
        $object = json_decode($json, true);
        $bencode = self::encode($object);

        return $bencode;
    }
373423
private function depthHandler(array $json)
    {
        $symbol = $json['s'];
        if ($json['u'] <= $this->info[$symbol]['firstUpdate']) {
            return;
        }

        foreach ($json['b'] as $bid) {
            $this->depthCache[$symbol]['bids'][$bid[0]] = $bid[1];
            if ($bid[1] == "0.00000000") {
                unset($this->depthCache[$symbol]['bids'][$bid[0]]);
            }

        }
        foreach ($json['a'] as $ask) {
            $this->depthCache[$symbol]['asks'][$ask[0]] = $ask[1];
            if ($ask[1] == "0.00000000") {
                unset($this->depthCache[$symbol]['asks'][$ask[0]]);
            }

        }
    }
336586
public function json(array $json = [], $assoc = false)
    {
        $this->options['json']       = $json;
        $this->options['json_assoc'] = $assoc;
        return $this;
    }
1321592
private function decodeJSON($json)
    {
        $query = json_decode($json);

        if (json_last_error()) {
            throw new QBParseException('JSON parsing threw an error: '.json_last_error_msg());
        }

        if (!is_object($query)) {
            throw new QBParseException('The query is not valid JSON');
        }

        return $query;
    }
23432
public function searchAction(Request $request, $string)
    {
        $ret = [];

        foreach ($this->getFinderRegistry()->all() as $searcher) {
            $local = $searcher->find($string, false, 16);
            if ($local) {
                foreach ($local as $result) {
                    $ret[] = [
                        'id'          => $result->getId(),
                        'type'        => $result->getType(),
                        'title'       => check_plain($result->getTitle()),
                        'group'       => check_plain($result->getGroup()),
                        'description' => check_plain($result->getDescription()),
                    ];
                }
            }
        }

        return new JsonResponse($ret);
    }
1150353
protected function fetchJsonError($json) {
		if (isset($json->error)) {
			return array(
				'code' => $json->error->code,
				'message' => $json->error->message,
			);
		}
		else {
			return null;
		}
	}
429355
public static function get_Json( &$json )
    {
        if( $json instanceof Json ) {
            return $json;
        }
        return !is_null($json)
            ? new Json($json)
            : null
            ;
    }
982490
protected static function _parse_json($json) {
    $rval = json_decode($json);
    $error = json_last_error();
    if($error === JSON_ERROR_NONE && $rval === null) {
      $error = JSON_ERROR_SYNTAX;
    }
    switch($error) {
    case JSON_ERROR_NONE:
      break;
    case JSON_ERROR_DEPTH:
      throw new JsonLdException(
        'Could not parse JSON; the maximum stack depth has been exceeded.',
        'jsonld.ParseError');
    case JSON_ERROR_STATE_MISMATCH:
      throw new JsonLdException(
        'Could not parse JSON; invalid or malformed JSON.',
        'jsonld.ParseError');
    case JSON_ERROR_CTRL_CHAR:
    case JSON_ERROR_SYNTAX:
      throw new JsonLdException(
        'Could not parse JSON; syntax error, malformed JSON.',
        'jsonld.ParseError');
    case JSON_ERROR_UTF8:
      throw new JsonLdException(
        'Could not parse JSON from URL; malformed UTF-8 characters.',
        'jsonld.ParseError');
    default:
      throw new JsonLdException(
        'Could not parse JSON from URL; unknown error.',
        'jsonld.ParseError');
    }
    return $rval;
  }
27877
private function decodeJSON($json)
    {
        $query = json_decode($json);
        if (json_last_error()) {
            throw new \Exception('JSON parsing threw an error: '.json_last_error_msg());
        }
        if (!is_object($query)) {
            throw new \Exception('The query is not valid JSON');
        }

        return $query;
    }
758224
protected function fetchJsonError($json) {
		if (isset($json->error)) {
			return array(
				'code' => $json->error_code,
				'message' => $json->error_description,
			);
		}
		else {
			return null;
		}
	}
383804
protected function response($json)
    {
        if ($json instanceof PaginatedResource) {
            $json = json_encode($json);
        }

        return (new HttpFoundationFactory())->createResponse($this->addHeaders(new Response($json)));
    }
863330
public static function fromJson($json)
    {
        $responseData = json_decode($json, true);

        if ( ! $responseData)
            return new static(false, [ResponseV3::E_INVALID_JSON]);

        return static::fromArray($responseData);
    }
713589
public static function fromJson($json)
    {
        if (!is_object($json)) {
            $json = json_decode($json);
        }
        $collection = new static();

        foreach ($json->patches as $package => $patches) {
            foreach ($patches as $patch_json) {
                $patch = Patch::fromJson($patch_json);
                $collection->addPatch($patch);
            }
        }

        return $collection;
    }
435918
public static function create(array $json)
    {
        $getNearestZoneResponse = new GetNearestZoneResponse();
        $getNearestZoneResponse->setStatusCode($json['status_code']);
        $getNearestZoneResponse->setStatusMessage($json['status_message']);

        // If a 'response' is provided
        if (array_key_exists('response', $json) && isset($json['response'])) {
            $getNearestZoneResponseResponse = new GetNearestZoneResponseResponse();
            $getNearestZoneResponseResponse->setDistance($json['response']['distance']);
            $getNearestZoneResponseResponse->setLat($json['response']['lat']);
            $getNearestZoneResponseResponse->setLng($json['response']['lng']);
            $getNearestZoneResponseResponse->setName($json['response']['name']);
            $getNearestZoneResponseResponse->setRange($json['response']['range']);
            $getNearestZoneResponse->setResponse($getNearestZoneResponseResponse);
        }

        return $getNearestZoneResponse;
    }