<?php

namespace apexl\Io\modules\formbuilder\includes;

use apexl\Io\modules\formbuilder\includes\formField;

/**
 * @todo make this more generalised, allow for multiple fielded groups
 * Class repeatingFieldGroupField
 * @package apexl\Io\modules\formbuilder\includes
 */
class repeatingFieldGroupField extends formField
{
    public function __construct($name)
    {
        parent::__construct($name, 'repeatingFieldGroup');
    }

    public function addCategories($categories)
    {
        $this->field->categories = $categories;
        return $this;
    }

    public function setMaximumGroupRepeats($maxRepeats)
    {
        $this->field->maximumGroupRepeats = $maxRepeats;
        return $this;
    }

    public function setGroupPlaceholder($placeholder = '')
    {
        $this->field->groupPlaceholder = $placeholder;
        return $this;
    }
}
