<commit_before><?php
class Vpc_Abstract_List_Admin extends Vpc_Admin
{
    public function getExtConfig()
    {
        $class = Vpc_Abstract::getChildComponentClass($this->_class, 'child');
        $childConfig = Vpc_Admin::getInstance($class)->getExtConfig();
        
        return array_merge(parent::getExtConfig(), array(
            'xtype'=>'vpc.list',
            'childConfig'=>$childConfig
        ));
    }
    public function setup()
    {
        $class = Vpc_Abstract::getChildComponentClass($this->_class, 'child');
        Vpc_Admin::getInstance($class)->setup();

        if (!$this->_tableExists('vpc_composite_list')) {
            $sql = 'CREATE TABLE IF NOT EXISTS `vpc_composite_list` (
              `id` int(10) unsigned NOT NULL auto_increment,
              `component_id` varchar(255) NOT NULL,
              `component_class` varchar(255) NOT NULL,
              `pos` tinyint(4) NOT NULL,
              `visible` tinyint(4) NOT NULL,
              PRIMARY KEY  (`id`)
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;';
            $this->_db->query($sql);
        }
    }

    public function delete($componentId)
    {
        foreach ($this->_getRows($componentId) as $row) {
            $row->delete();
        }
    }
}
<commit_msg>Bei Composite-List wird der Cache für eine Komponente auch beim Hinzufügen einer Row gelöscht <commit_after><?php
class Vpc_Abstract_List_Admin extends Vpc_Admin
{
    public function onRowInsert($row)
    {
        // Weil hier keine neue Komponente erstellt wird, sondern ein Eintrag
        // in der bereits bestehenden dazukommt
        $this->_deleteCacheForRow($row);
    }
        
    public function getExtConfig()
    {
        $class = Vpc_Abstract::getChildComponentClass($this->_class, 'child');
        $childConfig = Vpc_Admin::getInstance($class)->getExtConfig();
        
        return array_merge(parent::getExtConfig(), array(
            'xtype'=>'vpc.list',
            'childConfig'=>$childConfig
        ));
    }
    public function setup()
    {
        $class = Vpc_Abstract::getChildComponentClass($this->_class, 'child');
        Vpc_Admin::getInstance($class)->setup();

        if (!$this->_tableExists('vpc_composite_list')) {
            $sql = 'CREATE TABLE IF NOT EXISTS `vpc_composite_list` (
              `id` int(10) unsigned NOT NULL auto_increment,
              `component_id` varchar(255) NOT NULL,
              `component_class` varchar(255) NOT NULL,
              `pos` tinyint(4) NOT NULL,
              `visible` tinyint(4) NOT NULL,
              PRIMARY KEY  (`id`)
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;';
            $this->_db->query($sql);
        }
    }

    public function delete($componentId)
    {
        foreach ($this->_getRows($componentId) as $row) {
            $row->delete();
        }
    }
}

{'fraction_non_alphanumeric': 0.1258347978910369, 'fraction_numerical': 0.00773286467486819, 'mean_word_length': 2.3131548311990686, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 26, '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': '4862812', 'n_tokens_mistral': 848, 'n_tokens_neox': 832, 'n_words': 175}