<commit_before><?php
class Vpc_Advanced_Amazon_Nodes_ProductsDirectory_Detail_Component extends Vpc_Abstract
{
    public static function getSettings()
    {
        $ret = parent::getSettings();
        return $ret;
    }

    public function getTemplateVars()
    {
        $ret = parent::getTemplateVars();
        $ret['product'] = $this->getData()->row;
        $ret['item'] = $ret['product']->getItem();
        $ret['similarProducts'] = array();
        foreach ($ret['item']->SimilarProducts as $p) {
            $p = $ret['product']->getModel()->getRow($p->ASIN);
            foreach ($p->getChildRows('ProductsToNodes') as $n) {
                $s = new Vps_Component_Select();
                $s->whereEquals('node_id', $n->node_id);
                $s->whereGenerator('detail');
                if ($this->getData()->parent->parent->countChildComponents($s)) {
                    $ret['similarProducts'][] = $this->getData()->parent->getChildComponent('_'.$p->asin);
                }
            }
        }
        return $ret;
    }
<commit_msg>jedes produkt nur einmal anzeigen<commit_after><?php
class Vpc_Advanced_Amazon_Nodes_ProductsDirectory_Detail_Component extends Vpc_Abstract
{
    public static function getSettings()
    {
        $ret = parent::getSettings();
        return $ret;
    }

    public function getTemplateVars()
    {
        $ret = parent::getTemplateVars();
        $ret['product'] = $this->getData()->row;
        $ret['item'] = $ret['product']->getItem();
        $ret['similarProducts'] = array();
        $asins = array();
        foreach ($ret['item']->SimilarProducts as $p) {
            if (in_array($p->ASIN, $asins)) continue;
            $asins[] = $p->ASIN;
            $p = $ret['product']->getModel()->getRow($p->ASIN);
            foreach ($p->getChildRows('ProductsToNodes') as $n) {
                $s = new Vps_Component_Select();
                $s->whereEquals('node_id', $n->node_id);
                $s->whereGenerator('detail');
                if ($this->getData()->parent->parent->countChildComponents($s)) {
                    $ret['similarProducts'][] = $this->getData()->parent->getChildComponent('_'.$p->asin);
                }
            }
        }
        return $ret;
    }

{'fraction_non_alphanumeric': 0.17250554323725056, 'fraction_numerical': 0.0, 'mean_word_length': 2.2934306569343064, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 43, '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': '7659547', 'n_tokens_mistral': 668, 'n_tokens_neox': 649, 'n_words': 104}