<commit_before><?php
class Kwc_Directories_Category_Detail_List_Events extends Kwc_Abstract_Composite_Events
{
    private function _canCreateUsIndirectly($class)
    {
        foreach (Kwc_Abstract::getChildComponentClasses($class) as $c) {
            if ($c == $this->_class) {
                return true;
            }
            if ($this->_canCreateUsIndirectly($c)) {
                return true;
            }
        }
        return false;
    }

    public function getListeners()
    {
        $ret = parent::getListeners();
        foreach (Kwc_Abstract::getComponentClasses() as $class) {
            if (is_instance_of($class, 'Kwc_Directories_Category_Directory_Component') && $this->_canCreateUsIndirectly($class)) {
                $childReference =
                    Kwc_Abstract::hasSetting($class, 'childReferenceName') ?
                    Kwc_Abstract::getSetting($class, 'childReferenceName') :
                    'Categories';
                foreach (call_user_func(array($this->_class, 'getItemDirectoryClasses'), $this->_class) as $dirCls) {
                    $dirModel = Kwc_Abstract::getSetting($dirCls, 'childModel');
                    $relModel = Kwf_Model_Abstract::getInstance($dirModel)->getDependentModel($childReference);
                    $ret[] = array(
                        'class' => $relModel,
                        'event' => 'Kwf_Component_Event_Row_Updated',
                        'callback' => 'onUpdateRow'
                    );
                    $ret[] = array(
                        'class' => $relModel,
                        'event' => 'Kwf_Component_Event_Row_Inserted',
                        'callback' => 'onUpdateRow'
                    );
                    $ret[] = array(
                        'class' => $relModel,
                        'event' => 'Kwf_Component_Event_Row_Deleted',
                        'callback' => 'onUpdateRow'
                    );
                }
            }
        }
        return $ret;
    }

    public function onUpdateRow(Kwf_Component_Event_Row_Abstract $ev)
    {
        foreach (call_user_func(array($this->_class, 'getItemDirectoryClasses'), $this->_class) as $dirCls) {
            $itemId = $ev->row->item_id;
            $this->fireEvent(new Kwc_Directories_List_EventItemUpdated($dirCls, $itemId));
        }
    }
}<commit_msg>fix event in cherry pick<commit_after><?php
class Kwc_Directories_Category_Detail_List_Events extends Kwc_Abstract_Composite_Events
{
    private function _canCreateUsIndirectly($class)
    {
        foreach (Kwc_Abstract::getChildComponentClasses($class) as $c) {
            if ($c == $this->_class) {
                return true;
            }
            if ($this->_canCreateUsIndirectly($c)) {
                return true;
            }
        }
        return false;
    }

    public function getListeners()
    {
        $ret = parent::getListeners();
        foreach (Kwc_Abstract::getComponentClasses() as $class) {
            if (is_instance_of($class, 'Kwc_Directories_Category_Directory_Component') && $this->_canCreateUsIndirectly($class)) {
                $childReference =
                    Kwc_Abstract::hasSetting($class, 'childReferenceName') ?
                    Kwc_Abstract::getSetting($class, 'childReferenceName') :
                    'Categories';
                foreach (call_user_func(array($this->_class, 'getItemDirectoryClasses'), $this->_class) as $dirCls) {
                    $dirModel = Kwc_Abstract::getSetting($dirCls, 'childModel');
                    $relModel = Kwf_Model_Abstract::getInstance($dirModel)->getDependentModel($childReference);
                    $ret[] = array(
                        'class' => $relModel,
                        'event' => 'Kwf_Component_Event_Row_Updated',
                        'callback' => 'onUpdateRow'
                    );
                    $ret[] = array(
                        'class' => $relModel,
                        'event' => 'Kwf_Component_Event_Row_Inserted',
                        'callback' => 'onUpdateRow'
                    );
                    $ret[] = array(
                        'class' => $relModel,
                        'event' => 'Kwf_Component_Event_Row_Deleted',
                        'callback' => 'onUpdateRow'
                    );
                }
            }
        }
        return $ret;
    }

    public function onUpdateRow(Kwf_Component_Event_Row_Abstract $ev)
    {
        foreach (call_user_func(array($this->_class, 'getItemDirectoryClasses'), $this->_class) as $dirCls) {
            $this->fireEvent(new Kwc_Directories_List_EventRowUpdated($dirCls, $ev->row));
        }
    }
}
{'fraction_non_alphanumeric': 0.11432214194645134, 'fraction_numerical': 0.0, 'mean_word_length': 1.7160992498557415, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 42, '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': '2550938', 'n_tokens_mistral': 1282, 'n_tokens_neox': 1225, 'n_words': 190}