protected function _getRelatedModels($associationTypes = [])
    {
        $models = $this->_action()->getConfig('scaffold.relations');

        if ($models === false) {
            return [];
        }

        if (empty($models)) {
            $associations = [];
            if (empty($associationTypes)) {
                $associations = $this->_table()->associations();
            } else {
                foreach ($associationTypes as $assocType) {
                    $associations = array_merge(
                        $associations,
                        $this->_table()->associations()->getByType($assocType)
                    );
                }
            }

            $models = [];
            foreach ($associations as $assoc) {
                $models[] = $assoc->getName();
            }
        }

        $models = Hash::normalize($models);

        $blacklist = $this->_action()->getConfig('scaffold.relations_blacklist');
        if (!empty($blacklist)) {
            $blacklist = Hash::normalize($blacklist);
            $models = array_diff_key($models, $blacklist);
        }

        foreach ($models as $key => $value) {
            if (!is_array($value)) {
                $models[$key] = [];
            }
        }

        return $models;
    }