function serialize($options, $contentNodeIDArray, $topNodeIDArray) { if ($options['node_assignment'] == 'main' && $this->attribute('main_node_id') != $this->attribute('node_id')) { return false; } if (!in_array($this->attribute('node_id'), array_keys($contentNodeIDArray))) { return false; } $dom = new DOMDocument('1.0', 'utf-8'); $nodeAssignmentNode = $dom->createElement('node-assignment'); if ($this->attribute('main_node_id') == $this->attribute('node_id')) { $nodeAssignmentNode->setAttribute('is-main-node', 1); } if (!in_array($this->attribute('node_id'), $topNodeIDArray)) { $parentNode = $this->attribute('parent'); $nodeAssignmentNode->setAttribute('parent-node-remote-id', $parentNode->attribute('remote_id')); } $nodeAssignmentNode->setAttribute('name', $this->attribute('name')); $nodeAssignmentNode->setAttribute('node-id', $this->attribute('node_id')); $nodeAssignmentNode->setAttribute('remote-id', $this->attribute('remote_id')); $nodeAssignmentNode->setAttribute('sort-field', eZContentObjectTreeNodeNoLanguage::sortFieldName($this->attribute('sort_field'))); $nodeAssignmentNode->setAttribute('sort-order', $this->attribute('sort_order')); $nodeAssignmentNode->setAttribute('priority', $this->attribute('priority')); return $nodeAssignmentNode; }