<commit_before><?php
class Vpc_Root_TrlRoot_Chained_Admin extends Vpc_Abstract_Admin
{
    //TODO sollte nicht mehr static sein wenn todo in Vps_Util_Component::duplicate erledigt wurde
    public static function duplicated(Vps_Component_Data $source, Vps_Component_Data $new)
    {
        $chained = Vps_Component_Data_Root::getInstance()
            ->getComponentsByClass('Vpc_Root_TrlRoot_Chained_Component', array('ignoreVisible'=>true)); //bySameClass wenn fkt nicht mehr static (todo oben erledigt)
        foreach ($chained as $c) {
            $sourceChained = Vpc_Chained_Trl_Component::getChainedByMaster($source, $c, array('ignoreVisible'=>true));
            $newChained = Vpc_Chained_Trl_Component::getChainedByMaster($new, $c, array('ignoreVisible'=>true));
            if (!$sourceChained || !$newChained) {
                throw new Vps_Exception("can't find chained components");
            }
            Vpc_Admin::getInstance($newChained->componentClass)->duplicate($sourceChained, $newChained);
        }
    }
}<commit_msg>Komponenten duplizieren mit masterAsChild fixen<commit_after><?php
class Vpc_Root_TrlRoot_Chained_Admin extends Vpc_Abstract_Admin
{
    //TODO sollte nicht mehr static sein wenn todo in Vps_Util_Component::duplicate erledigt wurde
    public static function duplicated(Vps_Component_Data $source, Vps_Component_Data $new)
    {
        $chained = Vps_Component_Data_Root::getInstance()
            ->getComponentsByClass('Vpc_Root_TrlRoot_Chained_Component', array('ignoreVisible'=>true)); //bySameClass wenn fkt nicht mehr static (todo oben erledigt)
        foreach ($chained as $c) {
            $sourceChained = Vpc_Chained_Trl_Component::getChainedByMaster($source, $c, array('ignoreVisible'=>true));
            $newChained = Vpc_Chained_Trl_Component::getChainedByMaster($new, $c, array('ignoreVisible'=>true));
            if (!$sourceChained) continue; //wenn sourceChained nicht gefunden handelt es sich zB um ein MasterAsChild - was ignoriert werden muss
            if (!$newChained) {
                throw new Vps_Exception("can't find chained components");
            }
            Vpc_Admin::getInstance($newChained->componentClass)->duplicate($sourceChained, $newChained);
        }
    }
}
{'fraction_non_alphanumeric': 0.10195035460992907, 'fraction_numerical': 0.0, 'mean_word_length': 4.026726057906459, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '5536979', 'n_tokens_mistral': 663, 'n_tokens_neox': 660, 'n_words': 141}