<commit_before><?php
class Kwc_Advanced_GoogleMap_Component extends Kwc_Advanced_GoogleMapView_Component
{
    public static function getSettings($param = null)
    {
        $ret = array_merge(parent::getSettings($param), array(
            'componentName' => trlKwfStatic('Google Maps'),
            'ownModel' => 'Kwc_Advanced_GoogleMap_Model',
            'default' => array(
                'zoom' => 8,
                'height' => 300
            ),
        ));
        $ret['componentCategory'] = 'special';
        $ret['componentIcon'] = 'map';
        $ret['generators']['child']['component']['text'] = 'Kwc_Basic_Text_Component';
        $ret['placeholder']['noCoordinates'] = trlKwfStatic('coordinates not entered');
        $ret['assetsAdmin']['dep'][] = 'KwfGoogleMapField';
        return $ret;
    }

    protected function _getOptions()
    {
        $row = $this->_getRow();
        $fields = array('coordinates', 'zoom', 'width', 'height', 'zoomControl',
            'mapTypeControl', 'routing', 'scrollwheel');
        foreach ($fields as $f) {
            if ($f == 'zoomControl') {
                $ret[$f] = $row->zoom_control;
            } else if ($f == 'mapTypeControl') {
                $ret[$f] = $row->map_type_control;
            } else {
                $ret[$f] = $row->$f;
            }
        }
        if (!isset($ret['coordinates'])) $ret['coordinates'] = '';
        return $ret;
    }
}<commit_msg>fix options conversion from db<commit_after><?php
class Kwc_Advanced_GoogleMap_Component extends Kwc_Advanced_GoogleMapView_Component
{
    public static function getSettings($param = null)
    {
        $ret = array_merge(parent::getSettings($param), array(
            'componentName' => trlKwfStatic('Google Maps'),
            'ownModel' => 'Kwc_Advanced_GoogleMap_Model',
            'default' => array(
                'zoom' => 8,
                'height' => 300
            ),
        ));
        $ret['componentCategory'] = 'special';
        $ret['componentIcon'] = 'map';
        $ret['generators']['child']['component']['text'] = 'Kwc_Basic_Text_Component';
        $ret['placeholder']['noCoordinates'] = trlKwfStatic('coordinates not entered');
        $ret['assetsAdmin']['dep'][] = 'KwfGoogleMapField';
        return $ret;
    }

    protected function _getOptions()
    {
        $row = $this->_getRow();
        $fields = array('coordinates', 'zoom', 'width', 'height', 'zoomControl',
            'mapTypeControl', 'routing', 'scrollwheel');
        foreach ($fields as $f) {
            if ($f == 'zoom') {
                $ret[$f] = intval($row->$f);
            } else if ($f == 'zoomControl') {
                $ret[$f] = !!$row->zoom_control;
            } else if ($f == 'mapTypeControl') {
                $ret[$f] = !!$row->map_type_control;
            } else {
                if (in_array($f, array('routing', 'scrollwheel'))) {
                    $ret[$f] = !!$row->$f;
                } else {
                    $ret[$f] = $row->$f;
                }
            }
        }
        if (!isset($ret['coordinates'])) $ret['coordinates'] = '';
        return $ret;
    }
}
{'fraction_non_alphanumeric': 0.17239185750636132, 'fraction_numerical': 0.002544529262086514, 'mean_word_length': 2.1169474727452924, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3381152', 'n_tokens_mistral': 937, 'n_tokens_neox': 903, 'n_words': 167}