import parsed data from raw json

@param array|object $data
@return jsonq
11488
public function collect($data)
    {
        $this->_map = $this->objectToArray($data);
        $this->_baseContents = &$this->_map;

        return $this;
    }
1017963
public static function fromArray(array $data)
	{
		return new self(
			!empty($data['code'])    ? $data['code']    : null,
			!empty($data['message']) ? $data['message'] : null,
			!empty($data['data'])    ? $data['data']    : null
		);
	}
1198982
public static function loadSerializedJsonJWE(array $data)
    {
        $jwe = new JWE();
        $jwe = $jwe->withCiphertext(Base64Url::decode($data['ciphertext']));

        self::populateIV($jwe, $data);
        self::populateAAD($jwe, $data);
        self::populateTag($jwe, $data);
        self::populateSharedProtectedHeaders($jwe, $data);
        self::populateSharedHeaders($jwe, $data);

        foreach ($data['recipients'] as $recipient) {
            $encrypted_key = self::getRecipientEncryptedKey($recipient);
            $recipient_headers = self::getRecipientHeaders($recipient);

            $jwe = $jwe->addRecipientWithEncryptedKey($encrypted_key, $recipient_headers);
        }

        return $jwe;
    }
1325087
public function convertObjectInFolder(array $data = null)
    {
        if (empty($data)) {
            return null;
        }

        $objectInFolderData = new ObjectInFolderData();
        $object = $this->convertObject($data[JSONConstants::JSON_OBJECTINFOLDER_OBJECT] ?? []);

        if ($object !== null) {
            $objectInFolderData->setObject($object);
        }

        $objectInFolderData->setPathSegment((string) $data[JSONConstants::JSON_OBJECTINFOLDER_PATH_SEGMENT] ?? null);
        $objectInFolderData->setExtensions($this->convertExtension($data, JSONConstants::getObjectInFolderKeys()));

        return $objectInFolderData;
    }
1205007
protected function createObjectFromData(array $data) {
    // determine if we are loading or creating
    $createFromLoadedData = (sizeof($data) > 0) ? true : false;

    // initialize data and oid
    $oid = null;
    $initialData = $data;
    if ($createFromLoadedData) {
      $oid = $this->constructOID($initialData);
      // cleanup data
      foreach($initialData as $name => $value) {
        if ($this->hasAttribute($name) || strpos($name, self::INTERNAL_VALUE_PREFIX) === 0) {
          $value = $this->convertValueFromStorage($name, $value);
          $initialData[$name] = $value;
        }
        else {
          unset($initialData[$name]);
        }
      }
    }

    // construct object
    $object = $this->createObject($oid, $initialData);
    return $object;
  }
85971
public function import($data) {
		
		if (! is_array($data)) {
			$data = $this->makeArray($data);
		}
		
		foreach($data as $key => $value) {
			$this->set($key, $value);
		}
	}
46849
public function importData($data)
    {
        foreach ($data as $key => $row) {
            if ($row) {
                try {
                    $success = $this->importOne($row);
                    $errorMessage = '';
                } catch (Exception $e) {
                    $success = false;
                    $errorMessage = $e->getMessage();
                }

                $this->statistics[$key] = ['r' => $success, 'm' => $errorMessage];
            }
        }

        $this->afterImport($data);
    }
1266749
public function parseReadData($data)
	{
		$results = array();

		foreach ($data as $row) {
			if (is_array($row)) {
				$key = $row['key'];
				$value = $row['value'];
			} elseif (is_object($row)) {
				$key = $row->key;
				$value = $row->value;
			} else {
				$msg = 'Expected array or object, got '.gettype($row);
				throw new \UnexpectedValueException($msg);
			}

			SettingsUtilities::set($results, $key, $value);
		}

		return $results;
	}
908201
public function convertObjectList(array $data = null)
    {
        if (empty($data)) {
            return null;
        }

        $objectList = new ObjectList();
        $objects = [];

        foreach ((array) ($data[JSONConstants::JSON_OBJECTLIST_OBJECTS] ?? []) as $objectData) {
            $object = $this->convertObject($objectData);

            if ($object !== null) {
                $objects[] = $object;
            }
        }

        $objectList->setObjects($objects);

        $objectList->setHasMoreItems(
            (boolean) ($data[JSONConstants::JSON_OBJECTLIST_HAS_MORE_ITEMS] ?? false)
        );

        if (isset($data[JSONConstants::JSON_OBJECTLIST_NUM_ITEMS])) {
            $objectList->setNumItems((integer) $data[JSONConstants::JSON_OBJECTLIST_NUM_ITEMS]);
        }

        $objectList->setExtensions($this->convertExtension($data, JSONConstants::getObjectListKeys()));

        return $objectList;
    }
790464
protected function serialize($data)
    {
        if ('' === trim($data)) {
            return null;
        }

        if (null === $result = json_decode($data, true)) {
            if (json_last_error() !== JSON_ERROR_NONE) {
                throw new ReadException(json_last_error_msg(), json_last_error());
            }
        }

        return new ParameterBag($result);
    }
531303
public function load($data)
    {
        foreach ($data as $row) {
            $this->put($row['id'], RequestEntity::createExisting($row));
        }

        return $this;
    }
316022
public function appendSerialized($data)
    {
        try {
            $data = Serializer::unserialize($data);
        } catch (ExceptionInterface $exception) {
            $this->_addException($exception);
        }

        if (is_object($data)) {
            $name = $this->_convertKeyNames(get_class($data));
            $this->appendData($name, $data);
        } elseif (is_array($data)) {
            $this->appendArray($data);
        } else {
            $this->appendData($this->_defaultDataName, $data);
        }

        if ($this->_objectCreation) {
            return $this->_afterAppendDataToNewObject();
        }
        return $this;
    }
233387
public function import(array $data)
    {
        $this->clearErrors();
        $result = true;

        foreach ($data as $section) {
            if ($this->importItem($section) === false) {
                $result = false;
            }
        }

        return $result;
    }
718454
public function load($data)
    {
        $data = json_decode($data, true);

        if (JSON_ERROR_NONE !== json_last_error()) {
            throw new \RuntimeException('Error: json decode failed. ' . json_last_error_msg(), 1);
        }

        $this->setData($data);

        return $this;
    }
244840
public function withParsedBody($data)
    {
        $request = $this->copy();

        $request->parseCondition = ($data === null ? null : false);
        
        if ($this->shouldUsePostData() && $data !== null) {
            $request->postData = $data;
            $request->parsedBody = null;
        } else {
            $request->parsedBody = $data;
        }
        
        return $request;
    }
699284
private function _toJson($data)
    {
        if ($data) {
            if (is_array($data)) {
                return json_encode($this->_toCleanArray($data));
            }

            return json_encode($data);
        }
    }
819271
public function makeFromJSON(string $data): \BearFramework\Emails\Email
    {
        return \BearFramework\Emails\Email::fromJSON($data);
    }