<commit_before><?php

/**
 * @author marcus
 */
class MultiRecordEditingField extends FormField
{
    /**
     *
     * @var ArrayList
     */
    protected $records;

    /**
     * Whether to override html editor heights
     *
     * @var int
     */
    protected $htmlEditorHeight = 6;

    /**
     * Should we use toggle Composites in layout ? 
     *
     * @var boolean
     */
    protected $useToggles = true;

    /**
     * @var FieldList
     */
    protected $children;
    protected $tabs;

    public function __construct($name, $title = null, $recordList = null)
    {
        parent::__construct($name, $title);

        $this->children = FieldList::create();

        $this->tabs = FieldList::create();

        $this->records = ArrayList::create();
        if ($recordList) {
            foreach ($recordList as $record) {
                $this->addRecord($record);
            }
        }
    }

    public function isComposite()
    {
        return true; // parent::isComposite();
    }

    public function collateDataFields(&$list, $saveableOnly = false)
    {
        foreach ($this->children as $field) {
            if ($field->isComposite()) {
                $field->collateDataFields($list, $saveableOnly);
            }

            $isIncluded = $field->hasData() && !$saveableOnly;
            if ($isIncluded) {
                $list[$field->getName()] = $field;
            }
        }
    }

    public function removeByName($fieldName, $dataFieldOnly = false)
    {
        return $this->children->removeByName($fieldName, $dataFieldOnly);
    }

    /**<commit_msg>Implemented replaceField (null impl for now)<commit_after><?php

/**
 * @author marcus
 */
class MultiRecordEditingField extends FormField
{
    /**
     *
     * @var ArrayList
     */
    protected $records;

    /**
     * Whether to override html editor heights
     *
     * @var int
     */
    protected $htmlEditorHeight = 6;

    /**
     * Should we use toggle Composites in layout ? 
     *
     * @var boolean
     */
    protected $useToggles = true;

    /**
     * @var FieldList
     */
    protected $children;
    protected $tabs;

    public function __construct($name, $title = null, $recordList = null)
    {
        parent::__construct($name, $title);

        $this->children = FieldList::create();

        $this->tabs = FieldList::create();

        $this->records = ArrayList::create();
        if ($recordList) {
            foreach ($recordList as $record) {
                $this->addRecord($record);
            }
        }
    }

    public function isComposite()
    {
        return true; // parent::isComposite();
    }
	
	public function replaceField($fieldName, $newField) {
		// noop for a mr editing field... for now
	}

    public function collateDataFields(&$list, $saveableOnly = false)
    {
        foreach ($this->children as $field) {
            if ($field->isComposite()) {
                $field->collateDataFields($list, $saveableOnly);
            }

            $isIncluded = $field->hasData() && !$saveableOnly;
            if ($isIncluded) {
                $list[$field->getName()] = $field;
            }
        }
    }

    public function removeByName($fieldName, $dataFieldOnly = false)
    {
        return $this->children->removeByName($fieldName, $dataFieldOnly);
    }

    /**
{'fraction_non_alphanumeric': 0.13572496263079223, 'fraction_numerical': 0.0005979073243647235, 'mean_word_length': 1.9350877192982456, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, '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': '4426361', 'n_tokens_mistral': 975, 'n_tokens_neox': 940, 'n_words': 209}