<commit_before><?php
class Kwc_Basic_Table_Trl_Component extends Kwc_Chained_Trl_Component
{
    public static function getSettings($masterComponentClass)
    {
        $ret = parent::getSettings($masterComponentClass);
        $ret['childModel'] = 'Kwc_Basic_Table_Trl_DataModel';
        $ret['extConfig'] = 'Kwc_Basic_Table_Trl_ExtConfig';
        return $ret;
    }

    public function getTemplateVars()
    {
        $ret = parent::getTemplateVars();
        $model = $this->getChildModel();
        $rows = $model->getRows($model->select()
            ->whereEquals('component_id', $this->getData()->componentId)
            ->whereEquals('visible', 1)
            ->order('pos')
        );
        $ret['dataRows'] = array();
        foreach ($rows as $row) {
            if ($row->visible) $ret['dataRows'][] = $row;
        }
        return $ret;
    }

    public function getChildModel()
    {
        $chained = $this->getData()->chained;
        $tableModelClass = Kwc_Abstract::getSetting($chained->componentClass, 'childModel');
        return new Kwc_Basic_Table_Trl_AdminModel(array(
            'proxyModel' => new $tableModelClass(),
            'trlModel' => new Kwc_Basic_Table_Trl_DataModel(array(
                'columnCount' => $chained->getComponent()->getColumnCount())
            )
        ));
    }

    public static function getStaticCacheMeta($componentClass)
    {
        $ret = parent::getCacheMeta();
        $ret[] = new Kwf_Component_Cache_Meta_Static_Model('Kwc_Basic_Table_Trl_DataModel');
        return $ret;
    }
}
<commit_msg>Use in settings defined child-model<commit_after><?php
class Kwc_Basic_Table_Trl_Component extends Kwc_Chained_Trl_Component
{
    public static function getSettings($masterComponentClass)
    {
        $ret = parent::getSettings($masterComponentClass);
        $ret['childModel'] = 'Kwc_Basic_Table_Trl_DataModel';
        $ret['extConfig'] = 'Kwc_Basic_Table_Trl_ExtConfig';
        return $ret;
    }

    public function getTemplateVars()
    {
        $ret = parent::getTemplateVars();
        $model = $this->getChildModel();
        $rows = $model->getRows($model->select()
            ->whereEquals('component_id', $this->getData()->componentId)
            ->whereEquals('visible', 1)
            ->order('pos')
        );
        $ret['dataRows'] = array();
        foreach ($rows as $row) {
            if ($row->visible) $ret['dataRows'][] = $row;
        }
        return $ret;
    }

    public function getChildModel()
    {
        $chained = $this->getData()->chained;
        $tableModelClass = Kwc_Abstract::getSetting($chained->componentClass, 'childModel');
        $trlModelClass = $this->_getSetting('childModel');
        return new Kwc_Basic_Table_Trl_AdminModel(array(
            'proxyModel' => new $tableModelClass(),
            'trlModel' => new $trlModelClass(array(
                'columnCount' => $chained->getComponent()->getColumnCount())
            )
        ));
    }

    public static function getStaticCacheMeta($componentClass)
    {
        $ret = parent::getCacheMeta();
        $ret[] = new Kwf_Component_Cache_Meta_Static_Model('Kwc_Basic_Table_Trl_DataModel');
        return $ret;
    }
}

{'fraction_non_alphanumeric': 0.13760896637608966, 'fraction_numerical': 0.0006226650062266501, 'mean_word_length': 2.7447552447552446, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 38, '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': '2742127', 'n_tokens_mistral': 951, 'n_tokens_neox': 948, 'n_words': 152}