private function serializePriv(Writer $writer, $privName, $privilege)
    {
        $writer->startElement('{DAV:}supported-privilege');

        $writer->startElement('{DAV:}privilege');
        $writer->writeElement($privName);
        $writer->endElement(); // privilege

        if (!empty($privilege['abstract'])) {
            $writer->writeElement('{DAV:}abstract');
        }
        if (!empty($privilege['description'])) {
            $writer->writeElement('{DAV:}description', $privilege['description']);
        }
        if (isset($privilege['aggregates'])) {
            foreach ($privilege['aggregates'] as $subPrivName => $subPrivilege) {
                $this->serializePriv($writer, $subPrivName, $subPrivilege);
            }
        }

        $writer->endElement(); // supported-privilege
    }
private function serializePriv(Writer $writer, $privName, $privilege)
    {
        $writer->startElement('{DAV:}supported-privilege');

        $writer->startElement('{DAV:}privilege');
        $writer->writeElement($privName);
        $writer->endElement(); // privilege

        if (!empty($privilege['abstract'])) {
            $writer->writeElement('{DAV:}abstract');
        }
        if (!empty($privilege['description'])) {
            $writer->writeElement('{DAV:}description', $privilege['description']);
        }
        if (isset($privilege['aggregates'])) {
            foreach ($privilege['aggregates'] as $subPrivName => $subPrivilege) {
                $this->serializePriv($writer, $subPrivName, $subPrivilege);
            }
        }

        $writer->endElement(); // supported-privilege
    }
private function serializePriv ( Writer $ writer , $ privName , $ privilege ) { $ writer -> startElement ( '{DAV:}supported-privilege' ) ; $ writer -> startElement ( '{DAV:}privilege' ) ; $ writer -> writeElement ( $ privName ) ; $ writer -> endElement ( ) ; // privilege if ( ! empty ( $ privilege [ 'abstract' ] ) ) { $ writer -> writeElement ( '{DAV:}abstract' ) ; } if ( ! empty ( $ privilege [ 'description' ] ) ) { $ writer -> writeElement ( '{DAV:}description' , $ privilege [ 'description' ] ) ; } if ( isset ( $ privilege [ 'aggregates' ] ) ) { foreach ( $ privilege [ 'aggregates' ] as $ subPrivName => $ subPrivilege ) { $ this -> serializePriv ( $ writer , $ subPrivName , $ subPrivilege ) ; } } $ writer -> endElement ( ) ; // supported-privilege }
Serializes a property.

This is a recursive function.

@param Writer $writer
@param string $privName
@param array  $privilege
Serializes a property .