NerdsAndCompany\Schematic\Models\SuperTableField::getBlockTypes PHP Method

getBlockTypes() protected method

protected getBlockTypes ( array $fieldDefinition, Craft\FieldModel $field ) : Craft\SuperTable_BlockTypeModel[]
$fieldDefinition array
$field Craft\FieldModel
return Craft\SuperTable_BlockTypeModel[]
    protected function getBlockTypes(array $fieldDefinition, FieldModel $field)
    {
        $blockTypes = $this->getSuperTableService()->getBlockTypesByFieldId($field->id);
        $index = 0;
        foreach ($fieldDefinition['blockTypes'] as $blockTypeDef) {
            $blockType = array_key_exists($index, $blockTypes) ? $blockTypes[$index] : new SuperTable_BlockTypeModel();
            $blockType->fieldId = $field->id;
            $this->populateBlockType($blockType, $blockTypeDef);
            $blockTypes[$index] = $blockType;
            ++$index;
        }
        return $blockTypes;
    }