public function addRows($rows)
    {
        foreach ($rows as $row) {
            $this->inputRows[] = $row;
            $inferredRow = $this->inferRow($row);
            foreach ($this->getFieldNames() as $fieldName) {
                /** @var BaseField $inferredField */
                $inferredField = $inferredRow[$fieldName];
                $inferredFieldType = $inferredField->getInferIdentifier($this->lenient);
                if (!array_key_exists($fieldName, $this->fieldsPopularity)) {
                    $this->fieldsPopularity[$fieldName] = [];
                    $this->fieldsPopularityObjects[$fieldName] = [];
                }
                if (!array_key_exists($inferredFieldType, $this->fieldsPopularity[$fieldName])) {
                    $this->fieldsPopularity[$fieldName][$inferredFieldType] = 0;
                    $this->fieldsPopularityObjects[$fieldName][$inferredFieldType] = $inferredField;
                }
                ++$this->fieldsPopularity[$fieldName][$inferredFieldType];
                arsort($this->fieldsPopularity[$fieldName]);
            }
        }
    }
public function addRows($rows)
    {
        foreach ($rows as $row) {
            $this->inputRows[] = $row;
            $inferredRow = $this->inferRow($row);
            foreach ($this->getFieldNames() as $fieldName) {
                /** @var BaseField $inferredField */
                $inferredField = $inferredRow[$fieldName];
                $inferredFieldType = $inferredField->getInferIdentifier($this->lenient);
                if (!array_key_exists($fieldName, $this->fieldsPopularity)) {
                    $this->fieldsPopularity[$fieldName] = [];
                    $this->fieldsPopularityObjects[$fieldName] = [];
                }
                if (!array_key_exists($inferredFieldType, $this->fieldsPopularity[$fieldName])) {
                    $this->fieldsPopularity[$fieldName][$inferredFieldType] = 0;
                    $this->fieldsPopularityObjects[$fieldName][$inferredFieldType] = $inferredField;
                }
                ++$this->fieldsPopularity[$fieldName][$inferredFieldType];
                arsort($this->fieldsPopularity[$fieldName]);
            }
        }
    }
public function addRows ( $ rows ) { foreach ( $ rows as $ row ) { $ this -> inputRows [ ] = $ row ; $ inferredRow = $ this -> inferRow ( $ row ) ; foreach ( $ this -> getFieldNames ( ) as $ fieldName ) { /** @var BaseField $inferredField */ $ inferredField = $ inferredRow [ $ fieldName ] ; $ inferredFieldType = $ inferredField -> getInferIdentifier ( $ this -> lenient ) ; if ( ! array_key_exists ( $ fieldName , $ this -> fieldsPopularity ) ) { $ this -> fieldsPopularity [ $ fieldName ] = [ ] ; $ this -> fieldsPopularityObjects [ $ fieldName ] = [ ] ; } if ( ! array_key_exists ( $ inferredFieldType , $ this -> fieldsPopularity [ $ fieldName ] ) ) { $ this -> fieldsPopularity [ $ fieldName ] [ $ inferredFieldType ] = 0 ; $ this -> fieldsPopularityObjects [ $ fieldName ] [ $ inferredFieldType ] = $ inferredField ; } ++ $ this -> fieldsPopularity [ $ fieldName ] [ $ inferredFieldType ] ; arsort ( $ this -> fieldsPopularity [ $ fieldName ] ) ; } } }
add rows and updates the fieldsPopularity array - to make the inferred fields more accurate.

@param $rows

@throws FieldValidationException
add rows and updates the fieldsPopularity array - to make the inferred fields more accurate .