Permalink
Browse files

Fix issue with RepeaterPageArray lacking a makeNew() method.

  • Loading branch information...
1 parent e1c66b3 commit 9b3039dfc8d80a4cb910dad76a9e6dfa7592c1ab @ryancramerdesign committed Nov 14, 2012
Showing with 16 additions and 0 deletions.
  1. +16 −0 wire/modules/Fieldtype/FieldtypeRepeater/FieldtypeRepeater.module
@@ -1325,6 +1325,22 @@ class RepeaterPageArray extends PageArray {
return $page;
}
+
+ /**
+ * Creates a new blank instance of a RepeaterPageArray. For internal use.
+ *
+ * Note that this method has no relation/similarity to the getNewItem()/getNew() methods.
+ *
+ * @param array $items Array of items to populate (optional)
+ * @return WireArray
+ *
+ */
+ public function makeNew() {
+ $class = get_class($this);
+ $newArray = new $class($this->parent, $this->field);
+ return $newArray;
+ }
+
}

0 comments on commit 9b3039d

Please sign in to comment.