فهرست منبع

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

Add getter for the xml serialization visitor defaultRootName property
Johannes 12 سال پیش
والد
کامیت
d654b5854e
1فایلهای تغییر یافته به همراه8 افزوده شده و 0 حذف شده
  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;
     }
 
+    /**
+     * @return boolean
+     */
+    public function hasDefaultRootName()
+    {
+        return 'result' === $this->defaultRootName;
+    }
+
     public function setDefaultVersion($version)
     {
         $this->defaultVersion = $version;