Przeglądaj źródła

Add getter for the xml serialization visitor defaultRootName property

Adrien Brault 12 lat temu
rodzic
commit
38fb68edc6
1 zmienionych plików z 8 dodań i 0 usunięć
  1. 8 0
      src/JMS/Serializer/XmlSerializationVisitor.php

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

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