Hello!
I still have a problem related to creation of repeater matrix types. There is a function:
public function createRepeaterMatrixField(string $name, array $options, bool $wipe = false)
{
$items = array_key_exists('matrixItems', $options) ? $options['matrixItems'] : null;
if ($items) unset($options['matrixItems']);
// var_dump($items);
// create field
$field = $this->createField($name, 'FieldtypeRepeaterMatrix', $options);
// populate matrix items
if ($field && wireInstanceOf($field, 'RepeaterMatrixField')) {
$this->setMatrixItems($field, $items, $wipe);
}
return $field;
}
$field variable is supposed to be RepeaterMatrixField, but it's only a Field. What I'm doing wrong? I use the code from the documentation from https://github.com/baumrock/RockMigrations/tree/dev#repeatermatrix-field. Can you please tell me why it's Field and not RepeaterMatrixField?
Edit 1: I think it's field because $this->createField returns Field but not RepeaterMatrixField.
Edit 2: If I use setMatrixItems, then items are being added in the second run.