Skip to content

Commit

Permalink
✨ Add Builder::addPartials for adding multiple partials in an array
Browse files Browse the repository at this point in the history
  • Loading branch information
Log1x committed Oct 24, 2024
1 parent e17b51a commit 713d55b
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
* @method FieldBuilder addOembed(string $name, array $args = [])
* @method FieldBuilder addPageLink(string $name, array $args = [])
* @method FieldBuilder addPartial(string $partial)
* @method FieldBuilder addPartials(array $partials)
* @method FieldBuilder addPassword(string $name, array $args = [])
* @method FieldBuilder addPostObject(string $name, array $args = [])
* @method FieldBuilder addRange(string $name, array $args = [])
Expand Down Expand Up @@ -104,6 +105,18 @@ public function addPartial(string $partial): self
return $this->addFields($partial);
}

/**
* Add multiple partials to the field group.
*/
public function addPartials(array $partials): self
{
foreach ($partials as $partial) {
$this->addPartial($partial);
}

return $this;
}

/**
* Retrieve the custom field types.
*/
Expand Down
1 change: 1 addition & 0 deletions src/Builder/AccordionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
* @method FieldBuilder addOembed(string $name, array $args = [])
* @method FieldBuilder addPageLink(string $name, array $args = [])
* @method FieldBuilder addPartial(string $partial)
* @method FieldBuilder addPartials(array $partials)
* @method FieldBuilder addPassword(string $name, array $args = [])
* @method FieldBuilder addPostObject(string $name, array $args = [])
* @method FieldBuilder addRange(string $name, array $args = [])
Expand Down
1 change: 1 addition & 0 deletions src/Builder/ChoiceFieldBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
* @method FieldBuilder addOembed(string $name, array $args = [])
* @method FieldBuilder addPageLink(string $name, array $args = [])
* @method FieldBuilder addPartial(string $partial)
* @method FieldBuilder addPartials(array $partials)
* @method FieldBuilder addPassword(string $name, array $args = [])
* @method FieldBuilder addPostObject(string $name, array $args = [])
* @method FieldBuilder addRange(string $name, array $args = [])
Expand Down
1 change: 1 addition & 0 deletions src/Builder/FieldBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
* @method FieldBuilder addOembed(string $name, array $args = [])
* @method FieldBuilder addPageLink(string $name, array $args = [])
* @method FieldBuilder addPartial(string $partial)
* @method FieldBuilder addPartials(array $partials)
* @method FieldBuilder addPassword(string $name, array $args = [])
* @method FieldBuilder addPostObject(string $name, array $args = [])
* @method FieldBuilder addRange(string $name, array $args = [])
Expand Down
1 change: 1 addition & 0 deletions src/Builder/FlexibleContentBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
* @method FieldBuilder addOembed(string $name, array $args = [])
* @method FieldBuilder addPageLink(string $name, array $args = [])
* @method FieldBuilder addPartial(string $partial)
* @method FieldBuilder addPartials(array $partials)
* @method FieldBuilder addPassword(string $name, array $args = [])
* @method FieldBuilder addPostObject(string $name, array $args = [])
* @method FieldBuilder addRange(string $name, array $args = [])
Expand Down
1 change: 1 addition & 0 deletions src/Builder/GroupBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
* @method FieldBuilder addOembed(string $name, array $args = [])
* @method FieldBuilder addPageLink(string $name, array $args = [])
* @method FieldBuilder addPartial(string $partial)
* @method FieldBuilder addPartials(array $partials)
* @method FieldBuilder addPassword(string $name, array $args = [])
* @method FieldBuilder addPostObject(string $name, array $args = [])
* @method FieldBuilder addRange(string $name, array $args = [])
Expand Down
1 change: 1 addition & 0 deletions src/Builder/RepeaterBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
* @method FieldBuilder addOembed(string $name, array $args = [])
* @method FieldBuilder addPageLink(string $name, array $args = [])
* @method FieldBuilder addPartial(string $partial)
* @method FieldBuilder addPartials(array $partials)
* @method FieldBuilder addPassword(string $name, array $args = [])
* @method FieldBuilder addPostObject(string $name, array $args = [])
* @method FieldBuilder addRange(string $name, array $args = [])
Expand Down
1 change: 1 addition & 0 deletions src/Builder/TabBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
* @method FieldBuilder addOembed(string $name, array $args = [])
* @method FieldBuilder addPageLink(string $name, array $args = [])
* @method FieldBuilder addPartial(string $partial)
* @method FieldBuilder addPartials(array $partials)
* @method FieldBuilder addPassword(string $name, array $args = [])
* @method FieldBuilder addPostObject(string $name, array $args = [])
* @method FieldBuilder addRange(string $name, array $args = [])
Expand Down

0 comments on commit 713d55b

Please sign in to comment.