Prechádzať zdrojové kódy

Merge pull request #114 from adrienbrault/xml-default-root

Add getter for the xml serialization visitor defaultRootName property
Johannes 12 rokov pred
rodič
commit
d654b5854e

+ 8 - 0
src/JMS/Serializer/XmlSerializationVisitor.php

@@ -46,6 +46,14 @@ class XmlSerializationVisitor extends AbstractVisitor
         $this->defaultRootName = $name;
     }
 
+    /**
+     * @return boolean
+     */
+    public function hasDefaultRootName()
+    {
+        return 'result' === $this->defaultRootName;
+    }
+
     public function setDefaultVersion($version)
     {
         $this->defaultVersion = $version;