Jackalope\Transport\Jackrabbit\Client::createNodeJsop PHP Method

createNodeJsop() protected method

create the node markup and a list of value dispatches for multivalue properties
protected createNodeJsop ( string $path, array $properties ) : string
$path string path to the current node with the last path segment being the node name
$properties array of this node
return string the xml for the node
    protected function createNodeJsop($path, $properties)
    {
        $body = '+' . $path . ' : {';
        $binaries = array();
        // first do the main properties, so they are certainly in the beginning
        $nodeCreationProperties = array("jcr:primaryType", "jcr:mixinTypes");
        foreach ($nodeCreationProperties as $name) {
            if (isset($properties[$name])) {
                $body .= json_encode($name) . ':' . json_encode($properties[$name]->getValueForStorage()) . ",";
            }
        }
        foreach ($properties as $name => $property) {
            if (in_array($name, $nodeCreationProperties)) {
                continue;
            }
            $value = $this->propertyToJsopString($property);
            if (!$value) {
                $binaries[] = $property;
            } else {
                $body .= json_encode($name) . ':' . json_encode($value) . ",";
            }
        }
        $body .= "}";
        $this->setJsopBody($body);
        foreach ($binaries as $binary) {
            $this->storeProperty($binary);
        }
    }