public function setRepeaters($contentKey, $className, $inputData = null)
{
$standalone = false;
if ($inputData === null && !isset($this->contenttypes[$contentKey])) {
return null;
}
if ($inputData === null) {
$inputData = $this->contenttypes[$contentKey]['fields'];
} else {
$standalone = true;
}
foreach ($inputData as $key => $data) {
$mapping = ['fieldname' => $key, 'attribute' => $this->camelize($key), 'type' => 'null', 'fieldtype' => $this->typemap['repeater'], 'tables' => ['field' => $this->schemaManager->getTableName('field'), 'field_value' => $this->schemaManager->getTableName('field_value')]];
if ($data['type'] === 'repeater') {
foreach ($data['fields'] as $rkey => &$value) {
$value['fieldname'] = $rkey;
if ($value['type'] === 'select' && isset($value['multiple']) && $value['multiple'] === true) {
$value['type'] = 'selectmultiple';
}
if (isset($this->typemap[$value['type']])) {
$value['fieldtype'] = $this->typemap[$value['type']];
} else {
$value['fieldtype'] = $this->typemap['text'];
}
}
if ($standalone) {
return $data;
}
$this->metadata[$className]['fields'][$key] = $mapping;
$this->metadata[$className]['fields'][$key]['data'] = $data;
}
}
}