Create a configuration object from the supplied JSON data.

@param ObjectAccess $data The parsed JSON data.

@return Configuration The newly created configuration object.
342580
protected function createConfiguration(ObjectAccess $data)
    {
        $autoloadData = new ObjectAccess(
            $data->getDefault('autoload', (object) array())
        );

        return new Configuration(
            $data->getDefault('name'),
            $data->getDefault('description'),
            $data->getDefault('version'),
            $data->getDefault('type'),
            $data->getDefault('keywords'),
            $data->getDefault('homepage'),
            $this->createTime($data->getDefault('time')),
            $this->arrayize($data->getDefault('license')),
            $this->createAuthors($data->getDefault('authors')),
            $this->createSupport($data->getDefault('support')),
            $this->objectToArray($data->getDefault('require')),
            $this->objectToArray($data->getDefault('require-dev')),
            $this->objectToArray($data->getDefault('conflict')),
            $this->objectToArray($data->getDefault('replace')),
            $this->objectToArray($data->getDefault('provide')),
            $this->objectToArray($data->getDefault('suggest')),
            $this->createAutoloadPsr($autoloadData->getDefault('psr-4')),
            $this->createAutoloadPsr($autoloadData->getDefault('psr-0')),
            $autoloadData->getDefault('classmap'),
            $autoloadData->getDefault('files'),
            $data->getDefault('include-path'),
            $data->getDefault('target-dir'),
            $this->createStability($data->getDefault('minimum-stability')),
            $data->getDefault('prefer-stable'),
            $this->createRepositories((array) $data->getDefault('repositories')),
            $this->createProjectConfiguration($data->getDefault('config')),
            $this->createScripts($data->getDefault('scripts')),
            $data->getDefault('extra'),
            $data->getDefault('bin'),
            $this->createArchiveConfiguration($data->getDefault('archive')),
            $data->data()
        );
    }
99271
protected function createNewInstance(array $data): object
    {
        $instance = self::getInstantiator()->instantiate($this->getEntityClass());

        $refl = $this->getReflection();

        foreach ($data as $key => $value) {
            $prop = $refl->getProperty($key);
            $prop->setAccessible(true);

            if ($value instanceof Closure) {
                $value = $value($instance, $this, $this->manager);
            }

            $prop->setValue($instance, $value);
        }

        return $instance;
    }
650973
protected function getOrCreateObject(?array $data = null)
    {
        if ($data === null) {
            return null;
        }

        return $this->objectManager->getOrCreateObject(
            $this->getClassName(),
            $data
        );
    }
948085
public function create($data)
    {
        $descriptor = new SeeDescriptor($data->getName());
        $descriptor->setDescription($data->getDescription());

        $reference = $data->getReference();

        if (substr($reference, 0, 7) !== 'http://'
            && substr($reference, 0, 8) !== 'https://'
            && $reference !== 'self'
            && $reference !== '$this'
        ) {
            // TODO: move this to the ReflectionDocBlock component
            // Expand FQCN part of the FQSEN
            $referenceParts = explode('::', $reference);
            if (count($referenceParts) > 1 && $reference[0] != '\\') {
                $type = current($referenceParts);
                $type = new Collection(
                    array($type),
                    $data->getDocBlock() ? $data->getDocBlock()->getContext() : null
                );
                $referenceParts[0] = $type;
            } elseif (isset($reference[0]) && $reference[0] != '\\') {
                array_unshift($referenceParts, Linker::CONTEXT_MARKER);
            }

            $reference = implode('::', $referenceParts);
        }

        $descriptor->setReference($reference);

        return $descriptor;
    }
507255
public function create_data( $data = [] ) {
		if ( is_object( $data ) && method_exists( $data, 'to_array' )  ) {
			return $data->to_array();
		}

		return is_array( $data ) ? $data : [];
	}
824869
public function createReference($data)
	{
		// Get the data ready for creation.
		switch(gettype($data))
		{
			// Use an Object to update.
			case 'object':
				// Add entity type and key to creation data.
				$createData = ['entity_type' => $data->getType(), 'entity_id' => $data->getKey()];
			break;

			default:
				$createData = $data;
			break;
		}

		// Create the newly created entity's EntityIdentifier.
		return $this->aggregate[ReferenceServiceProvider::getProviderKey()]->create($createData);
	}
1094535
public function create($data)
    {
        $descriptor = new ThrowsDescriptor($data->getName());
        $descriptor->setDescription($data->getDescription());
        $descriptor->setTypes(
            $this->builder->buildDescriptor(new Collection($data->getTypes()))
        );

        return $descriptor;
    }
495966
public function create($data)
    {
        $response = $this->api->post($this->url(), $data);
        $className = $this->objectClass;

        return new $className($this->api, $this, $response->data);
    }
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;
    }
899015
public function create($data)
    {
        $methodDescriptor = new MethodDescriptor();
        $methodDescriptor->setNamespace(
            substr(
                (string) $data->getFqsen(),
                0,
                -strlen($data->getName()) - 4
            )
        );
        $this->mapReflectorToDescriptor($data, $methodDescriptor);

        $this->assembleDocBlock($data->getDocBlock(), $methodDescriptor);
        $this->addArguments($data, $methodDescriptor);
        $this->addVariadicArgument($data, $methodDescriptor);

        return $methodDescriptor;
    }
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);
    }
1296036
protected function create(array $data)
    {
        return User::create([
            'name' => $data['name'],
            'email' => $data['email'],
            'password' => bcrypt($data['password']),
            'token' => $this->userRepository->createToken(),
            'active' => 1,
        ]);
    }
348303
public function create($data)
    {
        $methodDescriptor = new MethodDescriptor();
        $this->mapReflectorToDescriptor($data, $methodDescriptor);

        $this->assembleDocBlock($data->getDocBlock(), $methodDescriptor);
        $this->addArguments($data, $methodDescriptor);
        $this->addVariadicArgument($data, $methodDescriptor);

        return $methodDescriptor;
    }
49858
public function store($data)
    {
        $template = $this->client->post('templates.json', [
            'json' => $data,
        ]);

        return new Template($this->response($template));
    }
646519
public function create(array $data)
    {
        $response = $this->ontraport->post(
            $this->getNamespace(), $this->toArray($data)
        );

        return $this->ontraport->item($this, $response);
    }
247139
public function create($data)
    {
        /* ACCESS CHECK */
        if (!$this->isAllowed(ResourceName::RESOURCE_SITES, 'admin')) {
            $this->getResponse()->setStatusCode(Response::STATUS_CODE_401);

            return $this->getResponse();
        }
        /* */

        $inputFilter = new SiteInputFilter();
        $inputFilter->setData($data);

        if (!$inputFilter->isValid()) {
            return new ApiJsonModel(
                [],
                1,
                'Some values are missing or invalid.',
                $inputFilter->getMessages()
            );
        }

        $data = $inputFilter->getValues();

        $siteManager = $this->getSiteManager();
        $userId = $this->getCurrentUserId();

        $data = $siteManager->prepareSiteData($data);
        /** @var \Rcm\Repository\Domain $domainRepo */
        $domainRepo = $this->getEntityManager()->getRepository(
            \Rcm\Entity\Domain::class
        );

        $data['domain'] = $domainRepo->createDomain(
            $data['domainName'],
            $userId,
            'Create new domain in ' . get_class($this)
        );

        /** @var \Rcm\Entity\Site $newSite */
        $newSite = new Site(
            $userId,
            'Create new site in ' . get_class($this)
        );

        $newSite->populate($data);
        // make sure we don't have a siteId
        $newSite->setSiteId(null);

        $newSite = $siteManager->createSite($newSite);

        return new ApiJsonModel($newSite, 0, 'Success');
    }
10648
protected function fromArray( array $data )
	{
		$conf = [];

		if( isset( $data['config']['key'] ) )
		{
			foreach( (array) $data['config']['key'] as $idx => $key )
			{
				if( trim( $key ) !== '' && isset( $data['config']['val'][$idx] ) )
				{
					if( ( $val = json_decode( $data['config']['val'][$idx] ) ) === null ) {
						$conf[$key] = $data['config']['val'][$idx];
					} else {
						$conf[$key] = $val;
					}
				}
			}
		}

		$manager = \Aimeos\MShop::create( $this->getContext(), 'service' );

		if( isset( $data['service.id'] ) && $data['service.id'] != '' ) {
			$item = $manager->getItem( $data['service.id'], $this->getDomains() );
		} else {
			$item = $manager->createItem();
		}

		$item->fromArray( $data, true );
		$item->setConfig( $conf );

		return $item;
	}