Creates a new content type create struct. If the identifier is not specified, a custom one is given.

@return ContentTypeCreateStruct
6815
public function newContentTypeCreateStruct($identifier = null)
    {
        return $this->contentTypeService->newContentTypeCreateStruct(
            $identifier ?: $identifier = str_replace('.', '', uniqid('content_type_', true))
        );
    }
894649
public function createRelationFromCreateStruct(RelationCreateStruct $struct)
    {
        $relation = new Relation();

        $relation->destinationContentId = $struct->destinationContentId;
        $relation->sourceContentId = $struct->sourceContentId;
        $relation->sourceContentVersionNo = $struct->sourceContentVersionNo;
        $relation->sourceFieldDefinitionId = $struct->sourceFieldDefinitionId;
        $relation->type = $struct->type;

        return $relation;
    }
185899
public function build(): GetContentQuadsRequest
	{
		$instance = new GetContentQuadsRequest();
		$instance->nodeId = $this->nodeId;
		$instance->backendNodeId = $this->backendNodeId;
		$instance->objectId = $this->objectId;
		return $instance;
	}
1173234
public function createMaterial()
    {
        $m = Material::factory( $this->materialsType, $this->materialsTable );
        $m->idcat = $this->id;
        return $m;
    }
757722
public function create()
    {
        $class = $this->getClass();
        $contentType = new $class();

        $schema = $this->schemaManager->create();
        $schema->setObjectClass($this->contentManager->getClass());

        $contentType->setSchema($schema);

        return $contentType;
    }
384973
private function newExpr() {
    $node = new NewNode();
    $this->mustMatch(T_NEW, $node);
    $node->addChild($this->classNameReference(), 'className');
    if ($this->currentType === '(') {
      $this->functionCallParameterList($node);
    }
    return $node;
  }
915311
public function createGroupFromCreateStruct(GroupCreateStruct $struct)
    {
        $group = new Group();

        $group->name = $struct->name;

        // $group->description is intentionally left out, since DB structure does not support it, yet

        $group->identifier = $struct->identifier;
        $group->created = $struct->created;
        $group->modified = $struct->modified;
        $group->creatorId = $struct->creatorId;
        $group->modifierId = $struct->modifierId;

        return $group;
    }
133426
public function insertContentObject(CreateStruct $struct, $currentVersionNo = 1)
    {
        $initialLanguageId = !empty($struct->mainLanguageId) ? $struct->mainLanguageId : $struct->initialLanguageId;
        $initialLanguageCode = $this->languageHandler->load($initialLanguageId)->languageCode;

        if (isset($struct->name[$initialLanguageCode])) {
            $name = $struct->name[$initialLanguageCode];
        } else {
            $name = '';
        }

        $q = $this->dbHandler->createInsertQuery();
        $q->insertInto(
            $this->dbHandler->quoteTable('ezcontentobject')
        )->set(
            $this->dbHandler->quoteColumn('id'),
            $this->dbHandler->getAutoIncrementValue('ezcontentobject', 'id')
        )->set(
            $this->dbHandler->quoteColumn('current_version'),
            $q->bindValue($currentVersionNo, null, \PDO::PARAM_INT)
        )->set(
            $this->dbHandler->quoteColumn('name'),
            $q->bindValue($name, null, \PDO::PARAM_STR)
        )->set(
            $this->dbHandler->quoteColumn('contentclass_id'),
            $q->bindValue($struct->typeId, null, \PDO::PARAM_INT)
        )->set(
            $this->dbHandler->quoteColumn('section_id'),
            $q->bindValue($struct->sectionId, null, \PDO::PARAM_INT)
        )->set(
            $this->dbHandler->quoteColumn('owner_id'),
            $q->bindValue($struct->ownerId, null, \PDO::PARAM_INT)
        )->set(
            $this->dbHandler->quoteColumn('initial_language_id'),
            $q->bindValue($initialLanguageId, null, \PDO::PARAM_INT)
        )->set(
            $this->dbHandler->quoteColumn('remote_id'),
            $q->bindValue($struct->remoteId, null, \PDO::PARAM_STR)
        )->set(
            $this->dbHandler->quoteColumn('modified'),
            $q->bindValue(0, null, \PDO::PARAM_INT)
        )->set(
            $this->dbHandler->quoteColumn('published'),
            $q->bindValue(0, null, \PDO::PARAM_INT)
        )->set(
            $this->dbHandler->quoteColumn('status'),
            $q->bindValue(ContentInfo::STATUS_DRAFT, null, \PDO::PARAM_INT)
        )->set(
            $this->dbHandler->quoteColumn('language_mask'),
            $q->bindValue(
                $this->generateLanguageMask(
                    $struct->fields,
                    $initialLanguageCode,
                    $struct->alwaysAvailable
                ),
                null,
                \PDO::PARAM_INT
            )
        );

        $q->prepare()->execute();

        return $this->dbHandler->lastInsertId(
            $this->dbHandler->getSequenceName('ezcontentobject', 'id')
        );
    }
35867
public function createContentTypeDraft($contentTypeId, Request $request)
    {
        $contentType = $this->contentTypeService->loadContentType($contentTypeId);

        try {
            $contentTypeDraft = $this->contentTypeService->createContentTypeDraft(
                $contentType
            );
        } catch (BadStateException $e) {
            throw new ForbiddenException($e->getMessage());
        }

        $contentTypeUpdateStruct = $this->inputDispatcher->parse(
            new Message(
                array(
                    'Content-Type' => $request->headers->get('Content-Type'),
                ),
                $request->getContent()
            )
        );

        try {
            $this->contentTypeService->updateContentTypeDraft(
                $contentTypeDraft,
                $contentTypeUpdateStruct
            );
        } catch (InvalidArgumentException $e) {
            throw new ForbiddenException($e->getMessage());
        }

        return new Values\CreatedContentType(
            array(
                'contentType' => new Values\RestContentType(
                    // Reload the content type draft to get the updated values
                    $this->contentTypeService->loadContentTypeDraft(
                        $contentTypeDraft->id
                    )
                ),
            )
        );
    }
251101
public function createTypeFromUpdateStruct(UpdateStruct $updateStruct): Type
    {
        $type = new Type();

        $type->name = $updateStruct->name;
        $type->description = $updateStruct->description;
        $type->identifier = $updateStruct->identifier;
        $type->modified = $updateStruct->modified;
        $type->modifierId = $updateStruct->modifierId;
        $type->remoteId = $updateStruct->remoteId;
        $type->urlAliasSchema = $updateStruct->urlAliasSchema;
        $type->nameSchema = $updateStruct->nameSchema;
        $type->isContainer = $updateStruct->isContainer;
        $type->initialLanguageId = $updateStruct->initialLanguageId;
        $type->defaultAlwaysAvailable = $updateStruct->defaultAlwaysAvailable;
        $type->sortField = $updateStruct->sortField;
        $type->sortOrder = $updateStruct->sortOrder;
        $type->languageCodes = array_keys($updateStruct->name);

        return $type;
    }
1352345
public static function createFromGlobals()
    {
        // With the php's bug #66606, the php's built-in web server
        // stores the Content-Type and Content-Length header values in
        // HTTP_CONTENT_TYPE and HTTP_CONTENT_LENGTH fields.
        $server = $_SERVER;
        if ('cli-server' === PHP_SAPI) {
            if (array_key_exists('HTTP_CONTENT_LENGTH', $_SERVER)) {
                $server['CONTENT_LENGTH'] = $_SERVER['HTTP_CONTENT_LENGTH'];
            }
            if (array_key_exists('HTTP_CONTENT_TYPE', $_SERVER)) {
                $server['CONTENT_TYPE'] = $_SERVER['HTTP_CONTENT_TYPE'];
            }
        }
        $request = self::createRequestFromFactory($_GET, $_POST, array(), $_COOKIE, $_FILES, $server);

        if (0 === strpos($request->headers->get('CONTENT_TYPE'), 'application/x-www-form-urlencoded')
            && in_array(
                strtoupper($request->server->get('REQUEST_METHOD', 'GET')),
                array('PUT', 'DELETE', 'PATCH')
            )
        ) {
            parse_str($request->getContent(), $data);
            $request->request = new ParameterRequest($data);
        }

        return $request;
    }
1216243
static public ContentHandleFactory newFactory() {
    return new ContentHandleFactory() {
      @Override
      public Class<?>[] getHandledClasses() {
        return new Class<?>[]{ XMLStreamReader.class };
      }
      @Override
      public boolean isHandled(Class<?> type) {
        return XMLStreamReader.class.isAssignableFrom(type);
      }
      @Override
      public <C> ContentHandle<C> newHandle(Class<C> type) {
        @SuppressWarnings("unchecked")
        ContentHandle<C> handle = isHandled(type) ?
                                  (ContentHandle<C>) new XMLStreamReaderHandle() : null;
        return handle;
      }
    };
  }
700813
public ParameterType<ConstructorType<T>> getOrCreateParameter()
   {
      List<Node> nodeList = childNode.get("parameter");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new ParameterTypeImpl<ConstructorType<T>>(this, "parameter", childNode, nodeList.get(0));
      }
      return createParameter();
   }
1194083
public static function create()
    {
        return parent::create()
            ->setSerializationContextFactory(array(self::class, 'createDefaultSerializationContext'))
            ->addDefaultHandlers()
            ->configureListeners(function (EventDispatcher $dispatcher) {
                $proxySubscriber = new DoctrineProxySubscriber(false);
                $dispatcher->addSubscriber($proxySubscriber);
            })
            ->configureHandlers(function (HandlerRegistryInterface $handlerRegistry) {
                $proxyHandler = new DoctrineProxyHandler();
                $handlerRegistry->registerSubscribingHandler($proxyHandler);
            })
        ;
    }
34697
public function build(): GetComputedStyleForNodeRequest
	{
		$instance = new GetComputedStyleForNodeRequest();
		if ($this->nodeId === null) {
			throw new BuilderException('Property [nodeId] is required.');
		}
		$instance->nodeId = $this->nodeId;
		return $instance;
	}
1085297
private function declareStructure()
    {
        $invoke = $this->method('__invoke')->setAccess(MethodDeclaration::ACCESS_PUBLIC);

        $invoke->parameter('request')->setType('Request');
        $invoke->parameter('response')->setType('Response');
        $invoke->parameter('next')->setType('callable');

        $invoke->setComment("{@inheritdoc}");
        $invoke->setSource('return $next($request, $response);');
    }
1182985
public function create()
    {
      $data = Ensure::Input(func_get_args());
      $url = URIResource::Make($this->path);
      $id = Locator::Find($this->client->post($url, $data->get()));
      $data->add("id", $id);

      return Constructor::Make($this, $data->get(), TRUE);
    }