function storeObjectAttribute($attribute) { if ($attribute->ID === null) { eZPersistentObject::storeObject($attribute); } $meta = $attribute->content(); $xmlString = self::saveXML($meta); $attribute->setAttribute('data_text', $xmlString); // save keywords $keyword = new eZKeyword(); $keyword->setKeywordArray($meta->keywords); $keyword->store($attribute); }
function storeObjectAttribute($attribute) { if ($attribute->ID === null) { eZPersistentObject::storeObject($attribute); } $meta = $attribute->content(); $xml = new DOMDocument("1.0", "UTF-8"); $xmldom = $xml->createElement("MetaData"); $node = $xml->createElement("title", htmlspecialchars($meta->title, ENT_QUOTES, 'UTF-8')); $xmldom->appendChild($node); $node = $xml->createElement("keywords", htmlspecialchars($meta->keywords, ENT_QUOTES, 'UTF-8')); $xmldom->appendChild($node); $node = $xml->createElement("description", htmlspecialchars($meta->description, ENT_QUOTES, 'UTF-8')); $xmldom->appendChild($node); $node = $xml->createElement("priority", htmlspecialchars($meta->priority, ENT_QUOTES, 'UTF-8')); $xmldom->appendChild($node); $node = $xml->createElement("change", htmlspecialchars($meta->change, ENT_QUOTES, 'UTF-8')); $xmldom->appendChild($node); $node = $xml->createElement("googlemap", htmlspecialchars($meta->googlemap, ENT_QUOTES, 'UTF-8')); $xmldom->appendChild($node); $xml->appendChild($xmldom); $node = $xml->createElement("urlsegment", htmlspecialchars($meta->urlsegment, ENT_QUOTES, 'UTF-8')); $xmldom->appendChild($node); $xml->appendChild($xmldom); $attribute->setAttribute('data_text', $xml->saveXML()); // save keywords $keyword = new eZKeyword(); $keyword->initializeKeyword($meta->keywords); $keyword->store($attribute); }