<commit_before><?php
/**
 * Basisklasse für Fields die andere Fields beinhalten
 *
 * zB FieldSet
 **/
abstract class Vps_Auto_Container_Abstract extends Vps_Auto_Field_Abstract implements IteratorAggregate
{
    public $fields;

    public function __construct($name = null)
    {
        parent::__construct($name);
        if (!isset($this->fields)) {
            $this->fields = new Vps_Collection();
        }
    }

    public function getMetaData()
    {
        $iterator = new RecursiveIteratorIterator(new Vps_Collection_Iterator_Recursive($this->fields));
        foreach ($iterator as $field) {
            if ($field instanceof Vps_Auto_Field_File) {
                $this->setFileUpload(true);
            }
            if ($field instanceof Vps_Auto_Field_File
                || $field instanceof Vps_Auto_Field_HtmlEditor) {
                $this->setLoadAfterSave(true);
            }
        }
        $ret = parent::getMetaData();
        $ret['name'] = $this->getName();
        $ret['items'] = $this->fields->getMetaData();
        return $ret;
    }

    public function getByName($name)<commit_msg>items nur ausgeben wenn items auch da<commit_after><?php
/**
 * Basisklasse für Fields die andere Fields beinhalten
 *
 * zB FieldSet
 **/
abstract class Vps_Auto_Container_Abstract extends Vps_Auto_Field_Abstract implements IteratorAggregate
{
    public $fields;

    public function __construct($name = null)
    {
        parent::__construct($name);
        if (!isset($this->fields)) {
            $this->fields = new Vps_Collection();
        }
    }

    public function getMetaData()
    {
        $iterator = new RecursiveIteratorIterator(new Vps_Collection_Iterator_Recursive($this->fields));
        foreach ($iterator as $field) {
            if ($field instanceof Vps_Auto_Field_File) {
                $this->setFileUpload(true);
            }
            if ($field instanceof Vps_Auto_Field_File
                || $field instanceof Vps_Auto_Field_HtmlEditor) {
                $this->setLoadAfterSave(true);
            }
        }
        $ret = parent::getMetaData();
        $ret['name'] = $this->getName();
        $ret['items'] = $this->fields->getMetaData();
        if (!count($ret['items'])) unset($ret['items']);
        return $ret;
    }

    public function getByName($name)
{'fraction_non_alphanumeric': 0.11870967741935484, 'fraction_numerical': 0.0, 'mean_word_length': 2.4820359281437128, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, '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': '947481', 'n_tokens_mistral': 652, 'n_tokens_neox': 650, 'n_words': 136}