]> git.mxchange.org Git - friendica-addons.git/blobdiff - dav/SabreDAV/lib/Sabre/VObject/Component.php
Move friendica-specific parts into an own subdirectory
[friendica-addons.git] / dav / SabreDAV / lib / Sabre / VObject / Component.php
index 6d4b28ac8a02a119fcd6f335428478dee82f14bc..ced5938488fcfc5c871e23f58385618be772e58a 100644 (file)
@@ -104,7 +104,7 @@ class Sabre_VObject_Component extends Sabre_VObject_Element {
          * @return int
          */
         $sortScore = function($key, $array) {
-            
+
             if ($array[$key] instanceof Sabre_VObject_Component) {
                 // We want to encode VTIMEZONE first, this is a personal
                 // preference.
@@ -264,6 +264,27 @@ class Sabre_VObject_Component extends Sabre_VObject_Element {
 
     }
 
+    /**
+     * Validates the node for correctness.
+     * An array is returned with warnings.
+     *
+     * Every item in the array has the following properties:
+     *    * level - (number between 1 and 3 with severity information)
+     *    * message - (human readable message)
+     *    * node - (reference to the offending node)
+     *
+     * @return array
+     */
+    public function validate() {
+
+        $result = array();
+        foreach($this->children as $child) {
+            $result = array_merge($result, $child->validate());
+        }
+        return $result;
+
+    }
+
     /* Magic property accessors {{{ */
 
     /**