processing rows and there heads
@return type
18916
protected function processRowsHeads() {
        $cols = $this->getCols();
        $this->data = $this->rows;
        if (!empty($cols)) {
            array_unshift($this->data, $cols);
        }
        return $this->data;
    }
1124533
public function current()
    {
        $this->seek($this->position);

        if ($this->count()) {
            return $this->rows[ $this->position ];
        }

        return new Row();
    }
630200
private function doProcessType()
	{
		$type = new Type($this->payment->type, $this->payment->toArray());

		$paymentExist = self::findDouble(
			$this->payment->id,
			$this->payment->term,
			$this->payment->order,
			$this->payment->amount,
			$type->sid(),
			array(Status::SUCCESS, Status::PROCESSED)
		);

		if ($paymentExist) {
			return '-3';
		}

		switch ($type->sid()) {

			case Type::AUTH:
			case Type::SALE:
			case Type::PAYMENT:
				break;

			case Type::COMPLETE:

				// completing auth request
				$payment = self::find(
					$this->payment->term,
					$this->payment->order,
					$this->payment->irn,
					$this->payment->rrn,
					Type::AUTH,
					Status::SUCCESS
				);

				if (!$payment) {
					return '-2';
				}
				break;

			case Type::REFUND:

				// refund for finished processing: sale, complete, payment
				$payment = self::find(
					$this->payment->term,
					$this->payment->order,
					$this->payment->irn,
					$this->payment->rrn,
					array(Type::SALE, Type::COMPLETE, Type::PAYMENT),
					Status::SUCCESS
				);

				if (!$payment) {

					// refund for not finishing processing: auth
					$payment = self::find(
						$this->payment->term,
						$this->payment->order,
						$this->payment->irn,
						$this->payment->rrn,
						Type::AUTH,
						Status::SUCCESS
					);

					if (!$payment) {
						return '-2';
					}

				}
				break;

		}

		return '00';

	}
408016
public function getCurrentRow()
        {
            if (isset($this->rows[($this->int_ptr - 1)])) {
                return $this->rows[($this->int_ptr - 1)];
            }
            return null;
        }
1096679
protected function processCurrentTable()
	{
		$firstRow = $this->table['rows'][0];
		$lastRow  = end($this->table['rows']);
		$this->createTableTags($firstRow['pos'], $lastRow['pos'] + strlen($lastRow['line']));

		$this->addTableHead();
		$this->createSeparatorTag($this->table['rows'][1]);
		$this->addTableBody();
	}
951680
public function fetchNextRow()
	{
		if( $this->cursor < $this->RecordCount() )
		{
			$this->cursor ++;
			$row = $this->rows[$this->cursor-1];
			return $row->getValues();
		}
		else return FALSE;
	}
261239
public function getFirstRow()
    {
        if (count($this->rows) == 0) {
            if (!is_null($this->summaryRow)) {
                return $this->summaryRow;
            }
            return false;
        }
        return reset($this->rows);
    }
1095578
public function autoDetectFileHasHeading() {
        if (empty($this->data)) {
            throw new \UnexpectedValueException('No data set yet.');
        }

        if ($this->heading) {
            $firstRow = $this->titles;
        } else {
            $firstRow = $this->data[0];
        }

        $firstRow = array_filter($firstRow);
        if (empty($firstRow)) {
            return false;
        }

        $firstRowDatatype = array_map(DatatypeEnum::class . '::getValidTypeFromSample', $firstRow);

        return $this->getMostFrequentDatatypeForColumn($firstRowDatatype) === DatatypeEnum::TYPE_STRING;
    }
772390
function setHead()
	{
		$this->head = array();
		$items = func_get_args();
		if (count($items)) foreach($items as $item) {
			if (is_string($item)) $this->head[] = array('text' => $item);
			elseif (is_array($item)) $this->head[] = $item;
		}
	}
301087
final protected function parseRow(): void
    {
        // only parse the next row if only one in buffer
        if (\count($this->bufferedRow) > 1) {
            return;
        }
        if (feof($this->file)) {
            $this->currentRow = null;

            return;
        }

        $this->currentRowEnded = false;
        // read file until row is ended
        while (!$this->currentRowEnded && !feof($this->file)) {
            $data = fread($this->file, 1024);
            xml_parse($this->parser, $data);
        }
    }
116962
public function next() {
		if ($this->currentRecord < count($this->rows)) {
			$row = $this->rows[$this->currentRecord];
			$this->currentRecord++;
			return $row;
		} else {
			return false;
		}
	}
1075542
protected function process()
    {
        $sourceFp = $this->getSourceFp();
        $destinationFp = $this->getDestinationFp();
        $index = $this->getIndex();
        
        // Extract duplicates in a separate file.
        $duplicateCount = 0;
        foreach ($index as $identifier => $positions) {
            if (count($positions) > 1) {
                // We have a duplicate.
                foreach ($positions as $pos) {
                    rewind($sourceFp);
                    fseek($sourceFp, $pos);
                    $sourceData = fgetcsv($sourceFp);
                    fputcsv($destinationFp, $sourceData);
                    $duplicateCount++;
                }
            }
        }
        
        return new Report(
            Report::TYPE_INFO,
            "${duplicateCount} duplicate records extracted in file '" . realpath($this->getDestination()) . "'."
        );
    }
1280137
public function process()
    {
        parent::process();

        foreach ($this->columns as $column) {
            $column->process();
        }

        foreach ($this->spanning_columns as $column) {
            $column->process();
        }

        foreach ($this->extra_rows as $row) {
            $row->process();
        }

        // this is part of the old selection API
        if ($this->hasColumn('checkbox')) {
            $items = $this->getColumn('checkbox');
            $this->checked_items = $items->getItems();
        }
    }
370517
protected function process()
    {

        // query whether or not, we've found a new path => means we've found a new category
        if ($this->hasBeenProcessed($path = $this->getValue(ColumnKeys::PATH))) {
            return;
        }

        // process the parent instance
        parent::process();

        // remove the path => row ID mapping from the subject
        $this->removePathRowIdMapping($path);
    }
691912
public function process()
    {
        $value = $this->value();
        if (!is_scalar($value) || $value === '') {
            return false;
        }

        $bool = (bool)$value;

        $nullValue = $this->getConfig('nullValue');
        $comparison = ' !=';
        if (!$bool) {
            $comparison = '';
        }
        if ($nullValue === null) {
            $comparison = ' IS NOT';
            if (!$bool) {
                $comparison = ' IS';
            }
        }

        if (!$this->manager()->getRepository() instanceof Table) {
            foreach ($this->fields() as $field) {
                $this->getQuery()->where([
                    $field . $comparison => $nullValue,
                ]);
            }

            return true;
        }

        $conditions = [];
        foreach ($this->fields() as $field) {
            $conditions[] = [$field . $comparison => $nullValue];
        }

        $this->getQuery()->andWhere([$this->getConfig('mode') => $conditions]);

        return true;
    }
180424
public function lastRow()
    {
        $query = clone $this;
        $offset = $this->limit ? $this->limit['start'] : 0;

        // Limit index to start in case of empty results
        $index = max($this->count() + $offset - 1, 0);
        $query->setLimit(1, $index);
        return $query;
    }
839442
protected function getHeaderRow()
    {
        $first_item = reset($this->data);

        $keys       = array_keys($first_item);
        $first_key  = reset($keys);

        // We have an associative array (probably), let's have a header row
        if (!is_int($first_key)) {
            return array_combine($keys, $keys);
        }

        return false;
    }