@param mixed $data

@return \stdClass
@throws \Exception
973556
public function store($data)
    {
        $response = Request::post($this->uri)
            ->authenticateWith($this->username, $this->password)
            ->body(json_encode($data))
            ->sendsType('application/json')
            ->send();

        return $this->processResponse($response);
    }
98831
protected function extractClassData($data)
    {
        $classData = array();
        if (isset($data['class'])) {
            foreach ($data['class'] as $key => $value) {
                $classData['class_'.$key] = $value;
            }
        }
        return $classData;
    }
1197364
public static function createFromData(array $data)
    {
        if (!isset($data['method'])) {
            throw new DomainException(self::REQUIRED_METHOD);
        }

        if (!in_array($data['method'], self::$availableMethods, true)) {
            throw new DomainException(
                sprintf(self::UNSUPPORTED_METHOD, implode(',', self::$availableMethods))
            );
        }

        return parent::createFromData($data);
    }
215905
private function loadPEM($data)
    {
        $data = base64_decode(preg_replace('#-.*-|\r|\n#', '', $data));
        $asnObject = Object::fromBinary($data);

        Assertion::isInstanceOf($asnObject, Sequence::class);

        $children = $asnObject->getChildren();
        if (4 === count($children)) {
            return $this->loadPrivatePEM($children);
        } elseif (2 === count($children)) {
            return $this->loadPublicPEM($children);
        }
        throw new \Exception('Unable to load the key');
    }
149448
public function make($data)
    {
        $driver = $this->instance ?? $this->createDriver();

        return $driver->init($data);
    }
501530
public function init($data)
    {
        $this->data = $data;

        switch (true) {

            case $this->isGdResource():
                return $this->initFromGdResource($this->data);

            case $this->isImagick():
                return $this->initFromImagick($this->data);

            case $this->isInterventionImage():
                return $this->initFromInterventionImage($this->data);

            case $this->isSplFileInfo():
                return $this->initFromPath($this->data->getRealPath());

            case $this->isBinary():
                return $this->initFromBinary($this->data);

            case $this->isUrl():
                return $this->initFromUrl($this->data);

            case $this->isStream():
                return $this->initFromStream($this->data);

            case $this->isDataUrl():
                return $this->initFromBinary($this->decodeDataUrl($this->data));

            case $this->isFilePath():
                return $this->initFromPath($this->data);

            // isBase64 has to be after isFilePath to prevent false positives
            case $this->isBase64():
                return $this->initFromBinary(base64_decode($this->data));

            default:
                throw new Exception\NotReadableException("Image source not readable");
        }
    }
1040263
public function getDataWrapper($data = null)
    {
        // if $data is set reconstruct the data wrapper
        if (!$this->dataWrapper || $data) {
            $this->dataWrapper = new DataWrapper\ArrayWrapper($data);
        }

        return $this->dataWrapper;
    }
513234
public function getData() : \stdClass
    {
        $output = new \stdClass();

        foreach ($this->data as $key => $property) {
            if ($this->options['lowercase']) {
                $key = strtolower($key);
            }

            $output->{$key} = $property;
        }

        return $output;
    }
972810
public function import($data)
    {
        if (isset($data['OXUSERNAME'])) {
            $id = $data['OXID'];
            $userName = $data['OXUSERNAME'];

            $user = oxNew(\OxidEsales\Eshop\Application\Model\User::class, "core");
            $user->oxuser__oxusername = new \OxidEsales\Eshop\Core\Field($userName, \OxidEsales\Eshop\Core\Field::T_RAW);

            if ($user->exists($id) && $id != $user->getId()) {
                throw new Exception("USER $userName already exists!");
            }
        }

        return parent::import($data);
    }
1261743
public static function classInfo($data)
    {
        $result = self::_getClass($data);
        if ($result) {
            $data = $result['name'];
        }

        return self::i()->dump($result, '! class (' . $data . ') !');
    }
579601
public function create( $data )
    {
        $structure = parent::create( $data );

        if ( $structure instanceof Structure\ProxyAbstract )
        {
            $structure->prepareCreate();
        }

        return $structure;
    }
702401
protected function handleResult($data)
    {
        if (empty($data->data)) {
            $data->data = new stdClass();
        }
        if ($data->http_code !== 200) {
            $data->data->is_error = true;
            $data->data->http_code = $data->http_code;
        }

        return $data->data;
    }
287730
private function parseJson(string $data): stdClass
    {
        $data = json_decode($data);

        if ($data instanceof stdClass) {
            return $data;
        }

        $errorCode = json_last_error();

        if ($errorCode !== JSON_ERROR_NONE) {
            throw JsonValidationException::parseError(json_last_error_msg(), $errorCode);
        }

        throw JsonValidationException::notAcceptable(
            sprintf('Expected a JSON object, got %s', gettype($data))
        );
    }
1089112
protected static function convert_fields(stdClass $data) {
        $data = parent::convert_fields($data);
        if (empty($data->scaleid)) {
            $data->scaleid = null;
            $data->scaleconfiguration = null;
        }
        return $data;
    }
459172
public function create($data) {

		// Create
		$bean = $this->universalCreate();

		// Catch exception, because bean might already have been created by property method.
		try {
			return $this->set($data, $bean);
		} catch (Exception $e) {
			// Delete bean
			$this->delete($bean->id);
			throw new \Exception( $e->getMessage() );
		}

	}
121489
public static function fromData(array $data)
    {
        $class = get_called_class();
        $isDynamic = is_a($class, DynamicEntity::class, true);

        /** @var static $entity */
        $entity = (new \ReflectionClass($class))->newInstanceWithoutConstructor();

        object_set_properties($entity, $data, $isDynamic);

        if (method_exists($entity, '__construct')) {
            $entity->__construct();
        }

        $entity->markNew(false);

        return $entity;
    }
1236511
protected function extractMeta(\StdClass $data)
    {
        if (isset($data->meta)) {
            $this->meta = new Meta($data->meta);
        }

        return $this->meta;
    }