Create new Atom node.

@param Node   $parent Parent node.
@param string $name   Element name.

@return Element|null

@since 1.0
350952
public function createElement(Node $parent, $name)
    {
        if (array_key_exists($name, $this->elementMap)) {
            $class = $this->elementMap[$name];

            return new $class($parent);
        }

        return null;
    }
110680
public function toXML(DOMElement $parent, string $name) : DOMElement
    {
        $e = $parent->ownerDocument->createElementNS(Constants::NS_MD, $name);
        $parent->appendChild($e);

        if (empty($this->Binding)) {
            throw new \Exception('Cannot convert endpoint to XML without a Binding set.');
        }
        if (empty($this->Location)) {
            throw new \Exception('Cannot convert endpoint to XML without a Location set.');
        }

        $e->setAttribute('Binding', $this->Binding);
        $e->setAttribute('Location', $this->Location);

        if ($this->ResponseLocation !== null) {
            $e->setAttribute('ResponseLocation', $this->ResponseLocation);
        }

        foreach ($this->attributes as $a) {
            $e->setAttributeNS($a['namespaceURI'], $a['qualifiedName'], $a['value']);
        }

        return $e;
    }
634280
public function create($name, $params = [ ])
    {
        if ($name !== null) {
            $name = $this->getName($name);
        } else {
            $name = $this->_base;
        }

        if (!isset($params['rule'])) {
            $params['rule'] = $this->_rule;
        }

        if (!isset($params['class'])) {
            $params['class'] = $this->_class;
        }

        return $this->link($name, $params);
    }
1028055
public function createDocument(Extensions $extensions, $name)
    {
        switch ($name) {
            case 'atom:entry':
                // No document — no exception.
                return new EntryDocument($extensions);
                break;
            case 'atom:feed':
                // No document — no exception.
                return new FeedDocument($extensions);
                break;
        }

        return null;
    }
188608
public static function createByActiveElements(
        string $name,
        int $n,
        array $activeElements
    ): ? self {
        $values = Metadata::fromMetadata($name);

        if (is_null($values)) {
            return null;
        }

        return new self(
            $values,
            in_array($values['id'], $activeElements),
            $n
        );
    }
1230086
public function createChildOf(array $attributes, Node $parent)
    {
        // Get new position
        $position = $this->getLastChildPosition($parent);
        $attributes[$this->getPositionName()] = $position;

        $model = $this->performCreateChildOf($attributes, $parent);

        return $model;
    }
834740
private function buildDefinitionBuilderNode($name)
    {
        $node = new ArrayNodeDefinition($name);

        $node
            ->children()
                ->booleanNode('public')
                    ->defaultFalse()
                    ->treatNullLike(false)
                ->end()
            ->end()
        ;

        return $node;
    }
1100486
public function create($name, $parentid = 1, $order = null, $id = null)
    {
        $params = array(
                   'name'       => $name,
                   'parentid'   => $parentid,
                   'order'      => $order,
                   'id'         => $id
                );

        $response = $this->http->jsonPost(self::API_CREATE, $params);

        return $response['id'];
    }
307876
function createSubNode( $node, $name )
    {
        $namedChildrenArray = $node->childrenByName( $name );
        $subNode = false;

        //pk
        if ( !$node->canCreate() )
        {
            $this->setError( self::ERROR_ACCESSDENIED, ezpI18n::tr( 'extension/ezodf/import/error', "Folder for images could not be created, access denied." ) );
            return false;
        }

        if ( empty( $namedChildrenArray ) )
        {
            $class = eZContentClass::fetchByIdentifier( "folder" );
            {
                $creatorID = $this->currentUserID;
                //$creatorID = 14; // 14 == admin
                $parentNodeID = $placeNodeID;
                $contentObject = $class->instantiate( $creatorID, 1 );

                $nodeAssignment = eZNodeAssignment::create( array(
                                                                 'contentobject_id' => $contentObject->attribute( 'id' ),
                                                                 'contentobject_version' => $contentObject->attribute( 'current_version' ),
                                                                 'parent_node' => $node->attribute( 'node_id' ),
                                                                 'is_main' => 1
                                                                 )
                                                             );
                $nodeAssignment->store();

                $version = $contentObject->version( 1 );
                $version->setAttribute( 'modified', eZDateTime::currentTimeStamp() );
                $version->setAttribute( 'status', eZContentObjectVersion::STATUS_DRAFT );
                $version->store();

                $contentObjectID = $contentObject->attribute( 'id' );
                $dataMap = $contentObject->dataMap();

                $titleAttribudeIdentifier = 'name';

                $dataMap[$titleAttribudeIdentifier]->setAttribute( 'data_text', $name );
                $dataMap[$titleAttribudeIdentifier]->store();

                $operationResult = eZOperationHandler::execute( 'content', 'publish', array( 'object_id' => $contentObjectID,
                                                                                             'version' => 1 ) );

                $subNode = $contentObject->mainNode();
            }
        }
        else
        {
            if ( count( $namedChildrenArray ) == 1 )
            {
                $subNode = $namedChildrenArray[0];
            }
        }

        return $subNode;
    }
923377
public function findChildrenByParentName($name)
    {
        $parent = $this->findOneByName($name);

        return $this->findChildrenByParentId($parent->getId());
    }
600011
protected function getOrCreateByPath($path, EloquentFile $parentNode=null)
    {
        $node = $this->getOrMakeByPath($path, $parentNode);

        if (!$node->getId()) {
            $this->save($node);
        }

        return $node;

    }
472479
private function addElement($name, $parent = false, $ns = false)
    {
        if ($ns) {
            $el = $this->doc->createElementNS($ns, $name);
        } else {
            $el = $this->doc->createElement($name);
        }
        if ($parent) {
            $parent->appendChild($el);
        }

        return $el;
    }
728038
protected function createNode(NodeInterface $parent)
    {
        $nodeType = $this->getNodeType();
        $name = $this->getName() ?: $this->nodeService->generateUniqueNodeName($parent->getPath());

        $node = $parent->createNode($name, $nodeType);

        $this->applyNodeCreationHandlers($node);

        $this->finish($node);
        // NOTE: we need to run "finish" before "addNodeCreatedFeedback" to ensure the new node already exists when the last feedback is processed
        $this->addNodeCreatedFeedback($node);

        return $node;
    }
35489
private function createNode($name, $options)
    {
        $node = $name . ' [';
        foreach ($options as $key => $value) {
            $node .= $key . '=' . $value . ' ';
        }
        $node .= "]\n";

        return $node;
    }
1152512
public static function fromNode($node, $parent) {
        if (is_null($node["value"]))
            return new Feature($node, $parent, $node->children());
        else
            return new ValueFeature($node, $parent, $node->children());
    }
614159
public function parent($name)
    {
        $placeholder = $this->placeholder($name);
        return isset($this->blocks[$placeholder]) ? $this->blocks[$placeholder] : '';
    }
137
protected function createComponent($name): ?IComponent
    {
        $method = 'createComponent'.ucfirst($name);
        if (method_exists($this, $method)) {
            $this->checkRequirements(self::getReflection()->getMethod($method));
        }

        return parent::createComponent($name);
    }