소스 검색

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;